[SERVER-29063] document not inserted properly - a populated ObjectId field is inserted as is, instead of as ObjectId Created: 04/May/17 Updated: 27/Oct/23 Resolved: 04/May/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | yi ba | Assignee: | Mark Agarunov |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
reconstruct:
Where field2 is of type ObjectId, and references another table, where 'someid' is the OID of some entry with a single key 'value' with value 'someval' . The collection model corresponds to that. Expected result: Actual result: |
| Comments |
| Comment by Mark Agarunov [ 04/May/17 ] | ||
|
Hello yinonby, Thank you for the report. Looking at the query you've provided, it appears that the behavior you're describing is expected. The way the query is structured,
Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group. Thanks, | ||
| Comment by yi ba [ 04/May/17 ] | ||
|
When I use an update with the same type of data, it is converted to an ObjectId. |