Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting a document with a field "_ids" does not return the generated ObjectID #281

Closed
csizmazia opened this issue Apr 5, 2016 · 2 comments
Labels

Comments

@csizmazia
Copy link

From the documentation, BulkWrite::insert($document) should:

If the document did not have an _id, a MongoDB\BSON\ObjectID will be generated and returned; otherwise, no value is returned.

However, when i want to insert a document which does not have a _id field, but does have a _ids field, this does not follow the above rule. NULL is returned instead of the expected generated ObjectID. The insert itself (performed by a Manager) works, though.

This happens with the latest version 1.1.5 from PECL.

@jmikola
Copy link
Member

jmikola commented Apr 5, 2016

Confirmed as a bug, which is being tracked in PHPC-667. Thanks for the report!

@jmikola
Copy link
Member

jmikola commented Apr 5, 2016

#284 is merged to v1.1 and will be released in 1.1.6. Please track the JIRA ticket above for updates.

@jmikola jmikola closed this as completed Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants