Skip to content

Conversation

@thekid
Copy link
Member

@thekid thekid commented Jul 19, 2025

Implements feature suggested in #47

use com\mongodb\Document;

// Creates a document without object ID
$chat= new Document(['topic' => 'Test', 'owner' => $identity]);

// Creates a document with a new object ID
$chat= Document::create(['topic' => 'Test', 'owner' => $identity]);

// Creates a (shallow) copy of the given document, assigning a new object ID
$copy= Document::create($chat);

@thekid thekid added the enhancement New feature or request label Jul 19, 2025
@thekid thekid merged commit fd291de into master Jul 19, 2025
12 checks passed
@thekid thekid deleted the feature/document-create branch July 19, 2025 21:23
@thekid
Copy link
Member Author

thekid commented Jul 19, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants