[SERVER-3210] Fields dropped when using update with $set Created: 06/Jun/11 Updated: 07/Mar/14 Resolved: 03/Sep/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 1.8.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Michael Cohen | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | insert | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu lucid deb from website, db version v1.8.1, pdfile version 4.5 |
||
| Operating System: | Linux |
| Participants: |
| Description |
|
Certain key values are lost with no warning when using $set to update a document. The following snippet illustrates: import pymongo document = {} collection = pymongo.Connection().test_db.data
print "Length of document %s" % len(document) collection.update(spec, {"$set": document}, upsert=False, safe=True) result = collection.find_one(spec) for key in document: This is the output Length of document 3000 Changing the formatter from %04X to %04d seems to bypass the issue. So there is something about a pattern in the text. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 03/Sep/11 ] |
|
See |