-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Hi!
I have an ObjectId generator in Javascript, which generates "_id" like "5394d7db560c9869a1000002", But when I pass this "_id" to "Moloquent" to do an insert it stores as a string instead of an ObjectId like "ObjectId('5394d7db560c9869a1000002')".
The only way I have found to solve this is to make a new MongoId with the pre-generated "_id".
$this->_id = new MongoId($obj['_id']);
$this->name = $obj['name'];
$this->save();
There is another more elegant way to do this? Thanks!
PD: (Sorry for my english)
Metadata
Metadata
Assignees
Labels
No labels