[SERVER-2037] Let array operators work on objects Created: 30/Oct/10  Updated: 17/Mar/11  Resolved: 31/Oct/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: John Crenshaw Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

The boundary between "array" and "object" is particularly blurry for some languages (like PHP). It can be very easy to accidentally write something out, thinking it is an array, only to have it actually be stored internally as an "object".

This wouldn't be a problem if array operators (such as $elemMatch, $in, $all, $slice, $size, $push, $pushAll, $addToSet, $pop, $pull, $pullAll) worked on objects. Also $insert and $remove from SERVER-2036 if/when they are implemented.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 31/Oct/10 ]

In most languages this doesn't make sense.

For example what would $push do to an object like

{ a : 1 , b : 2 }

Generated at Thu Feb 08 02:58:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.