-
Type: Question
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4.2
-
Component/s: Shell
-
None
-
Environment:CentOs 6.4
Hi
I have a few documents with the following structure:
{
"_id" : 64293,
"ispId" : 3,
"slaId" : 489451,
"type" : "VSAT",
"data" : [
,
,
,
,
...
]}
I need to update all documents where the "oid" equals a certain value, and set the "value" to another value.
I tried the following:
db.committedManagedElements.update(
,{$set:{"data.$.value":"/Basic.htm"}},false,true)
The result is that the field is updated but the internal order within the array component is changed for the updated. After update it is
,
when I need it to be
,
Is there a way to keep the order during update as well?
Thank you
Karin
- duplicates
-
SERVER-2592 The fields in a document are reordered (sorted alphabetically) when setting a field value
- Closed