-
Notifications
You must be signed in to change notification settings - Fork 123
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
BulkWrite error :: '$set' is empty. You must specify a field like so: {$set: {<field>: ...}} #93
Comments
I was seeing this last night also but after var_dumping around I was eventually no longer able to reproduce. I chalked it up to an environment issue but maybe that wasn't the case. Here is a screenshot that shows the filter, update and exception message http://d.pr/i/1ebti. Again I can no longer recreate so not positive that it is in fact the same but interesting that you are getting basically the same error. EDIT: Also this is using Doctrine ORM and the MongoId is generated with |
I've taken a look at what you provided and could not find anything that causes this. I've tried using the arguments from the exception message in a test and it doesn't fail:
I also tried updating a document that already exists, with the same result: works as expected. From what I can see, MongoDB ODM passes an Does the error still come up, and if so, is there anything special about the cases where it comes up? (e.g. always on upsert, only when using BSON types, only when doing multi-updates, and so on). |
Hey @alcaeus thanks for the reply. I will investigate more but at the moment I can definitely say that it happens on Update: I have also encountered the same problem with |
Closing this as it seems this was due to a bug in APCu - and also to consolidate discussion into the driver issue. |
Hey,
We recently switched our production server to PHP7:
And using the new Mongodb driver (1.1.5).
We noticed that sometimes there's a weird behaviour but unfortunately I can't reproduce it yet. When I run the code on dev it works perfectly. I am seeing the following error:
As you can see, the
$set
parameter is definitely not empty. I have tried to debug a bit but still can't figure this issue.I am not sure if this bug should be here or maybe in https://github.com/mongodb/mongo-php-driver/issues
The moment I have a way to reproduce it, will attach a code snippet but maybe in the meanwhile there's something I have missed.
Thank you
The text was updated successfully, but these errors were encountered: