[SERVER-6993] findAndModify positional operator regression with undotted query fields Created: 10/Sep/12 Updated: 11/Jul/16 Resolved: 19/Sep/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 2.2.0 |
| Fix Version/s: | 2.2.1, 2.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jhoanna Ilagan | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
We are in the works of upgrading our server to 2.2.0, however we hit an issue with this: https://jira.mongodb.org/browse/SERVER-6588. It appears that this has already been fixed on 2.2 rc1 and according to your roadmap it will be available on 9/25. Is this for the Production version or the Development version? If it's for Production release, when is the soonest we could get the Dev version? |
| Comments |
| Comment by auto [ 19/Sep/12 ] | ||||||||||
|
Author: {u'date': u'2012-09-18T17:26:54-07:00', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}Message: | ||||||||||
| Comment by auto [ 19/Sep/12 ] | ||||||||||
|
Author: {u'date': u'2012-09-18T17:26:54-07:00', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}Message: | ||||||||||
| Comment by Jhoanna Ilagan [ 11/Sep/12 ] | ||||||||||
|
Thanks for your help. This works for us. This ticket is resolved. | ||||||||||
| Comment by David Hows [ 11/Sep/12 ] | ||||||||||
|
While Jhoanna's query did not need an elemMatch the following query - which would need an elemMatch and use of the positional operator fails with the error Jhoanna noted. I am using Jhoanna's dataset, but have added a second sub element (status) thus the need for elemMatch. Query:
Error:
This appears to be an issue in the modify alone - as running this query when no document can be found that matches will cause the findAndModify to return a null. | ||||||||||
| Comment by David Hows [ 11/Sep/12 ] | ||||||||||
|
Hi Jhoanna, You dont need the elemMatch as only one sub element of the array is needed to be matched. ElemMatch is used when you need to match two or more elements of an array and ensure both are present in the same array element. I found removing the elemMatch worked as i believe you intended, that is the following query:
Having said that, if an elemMatch is needed there is an issue. I will make a separate comment for this. Cheers, David | ||||||||||
| Comment by Jhoanna Ilagan [ 10/Sep/12 ] | ||||||||||
|
We do have the Prod release of 2.2.0, and we seem to have the issue Here's what we're doing: mongoimport -d Test -c Batch /data/logs/batch.json Update the job: db.Batch.findAndModify({query: { "_id": }, update: { $set: { "job.$.endTime": new Date(1347060957254), , In version 2.2.0 I am getting error message uncaught exception: Thanks, | ||||||||||
| Comment by Daniel Pasette (Inactive) [ 10/Sep/12 ] | ||||||||||
|
This was fixed in the production release of 2.2.0. "rc1" stands for "release candidate 1" |