Steve Jerman | 24 May 2013 21:55
Picon

Using concat with aggregation...

I am trying to use an aggregation command to extract a monthly summary of data.


This projection works....

'$project'=>{ 
    'update'=> { 
    :year =>{ "$year" => "$fcsDate" },
    :month =>{ "$month" => "$fcsDate" }
    },
    'projectName'=>1,
'fcsDate'=>1,
   
    }},


  {"update":{"month":10,"year":2013},"fcsDate":"2013-10-14T00:00:00Z","_id":"519d06cf0c80e16a3800002f","projectName":"Project 3"}
....

What I really want is:
  {"update":"2013-10","fcsDate":"2013-10-14T00:00:00Z","_id":"519d06cf0c80e16a3800002f","projectName":"Project 3"}

But concat doesn't seem to work with numbers:

   {'$project'=>{ 
    'update'=> { 
    :year =>{ "$year" => "$fcsDate" },
    :month =>{ "$month" => "$fcsDate" }
    },
    'projectName'=>1,
'fcsDate'=>1,
   
    }},
   {'$project'=>{ 
    'month'=> { "$concat" => [ "$update.year","-","$update.month"]},
    'projectName'=>1,
'fcsDate'=>1,
   
    }},

/Library/Ruby/Gems/1.8/gems/mongo-1.8.6/lib/mongo/db.rb:548:in `command': Database command 'aggregate' failed: (errmsg: 'exception: $concat only supports strings, not NumberInt32'; code: '16702'; ok: '0.0'). (Mongo::OperationFailure)
from /Library/Ruby/Gems/1.8/gems/mongo-1.8.6/lib/mongo/collection.rb:667:in `aggregate'
from tree.rb:25

is there a function to convert a number to a string?
Steve

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Freddy Martinez | 24 May 2013 21:22
Picon

problem updating nested arrays

hi to everybody

i'm new using mongo and I need to know if exist any way to update one array nested into other array which nested into another one.

being more clear, I have this patient collection:

{
    "_id" : ObjectId("519c3c99398dbd9fcabe2042"),
    "(0010,0010)" : {
        "VR" : "PN",
        "VM" : 1,
        "value" : "ADARBE^NELFI"
    },
    "(0010,0020)" : {
        "VR" : "LO",
        "VM" : 1,
        "value" : "22758387"
    },
    "(0010,0030)" : {
        "VR" : "DA",
        "VM" : 1,
        "value" : "19481007"
    },
    "(0010,0040)" : {
        "VR" : "CS",
        "VM" : 1,
        "value" : "F"
    },
    "studies" : [
        {
            "(0008,0020)" : {
                "VR" : "DA",
                "VM" : 1,
                "value" : "20061122"
            },
            "(0008,0030)" : {
                "VR" : "TM",
                "VM" : 1,
                "value" : "144905"
            },
            "(0008,0050)" : {
                "VR" : "SH",
                "VM" : 0
            },
            "(0008,0090)" : {
                "VR" : "PN",
                "VM" : 0
            },
            "(0008,1030)" : {
                "VR" : "LO",
                "VM" : 0
            },
            "(0020,000d)" : {
                "VR" : "UI",
                "VM" : 1,
                "value" : "1.2.840.113663.1500.1.218819862.1.1.20061122.144905.562"
            },
            "(0020,0010)" : {
                "VR" : "SH",
                "VM" : 1,
                "value" : "20061122.144905"
            },
            "series" : [
                {
                    "(0008,0021)" : {
                        "VR" : "DA",
                        "VM" : 1,
                        "value" : "20061122"
                    },
                    "(0008,0031)" : {
                        "VR" : "TM",
                        "VM" : 1,
                        "value" : "144905"
                    },
                    "(0008,0060)" : {
                        "VR" : "CS",
                        "VM" : 1,
                        "value" : "US"
                    },
                    "(0008,0070)" : {
                        "VR" : "LO",
                        "VM" : 1,
                        "value" : "Philips Medical Systems"
                    },
                    "(0008,0080)" : {
                        "VR" : "LO",
                        "VM" : 1,
                        "value" : "CMDAT  Dr. S. ALLENDE"
                    },
                    "(0008,1010)" : {
                        "VR" : "SH",
                        "VM" : 1,
                        "value" : "eco3d"
                    },
                    "(0008,1090)" : {
                        "VR" : "LO",
                        "VM" : 1,
                        "value" : "iE33"
                    },
                    "(0020,000e)" : {
                        "VR" : "UI",
                        "VM" : 1,
                        "value" : "1.2.840.113663.1500.1.218819862.2.1.20061122.144905.562"
                    },
                    "(0020,0011)" : {
                        "VR" : "IS",
                        "VM" : 1,
                        "value" : "1"
                    },
                    "instances" : [
                        {
                            "(0008,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 552
                            },
                            "(0008,0008)" : {
                                "VR" : "CS",
                                "VM" : 3,
                                "value" : [
                                    "ORIGINAL",
                                    "PRIMARY",
                                    "CARDIOLOGY"
                                ]
                            },
                            "(0008,0012)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0013)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "145416"
                            },
                            "(0008,0016)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.10008.5.1.4.1.1.6.1"
                            },
                            "(0008,0018)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.113663.1500.1.218819862.3.2.20061122.145416.265"
                            },
                            "(0008,0023)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0033)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "145416"
                            },
                            "(0008,1070)" : {
                                "VR" : "PN",
                                "VM" : 1,
                                "value" : "TORNES"
                            },
                            "(0008,2111)" : {
                                "VR" : "ST",
                                "VM" : 1,
                                "value" : "Uncompressed"
                            },
                            "(0010,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 70
                            },
                            "(0010,4000)" : {
                                "VR" : "LT",
                                "VM" : 0
                            },
                            "(0018,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 460
                            },
                            "(0018,1000)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "218819862"
                            },
                            "(0018,1020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "PMS1.1 Ultrasound iE33_2.0.2.428"
                            },
                            "(0018,1030)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "Free Form"
                            },
                            "(0018,1088)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "0"
                            },
                            "(0018,5010)" : {
                                "VR" : "LO",
                                "VM" : 3,
                                "value" : [
                                    "S2",
                                    "",
                                    ""
                                ]
                            },
                            "(0018,5020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "CARD_ADULT_GEN_CV"
                            },
                            "(0020,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 172
                            },
                            "(0020,0013)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "2"
                            },
                            "(0028,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 152
                            },
                            "(0028,0002)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 3
                            },
                            "(0028,0004)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "RGB"
                            },
                            "(0028,0006)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0010)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 768
                            },
                            "(0028,0011)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1024
                            },
                            "(0028,0014)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1
                            },
                            "(0028,0100)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0101)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0102)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 7
                            },
                            "(0028,0103)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0301)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "YES"
                            },
                            "(0028,1050)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "127.0"
                            },
                            "(0028,1051)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "254.0"
                            },
                            "(0028,2110)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "00"
                            },
                            "(0040,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 230
                            },
                            "(0040,0241)" : {
                                "VR" : "AE",
                                "VM" : 1,
                                "value" : "ECO-3D"
                            },
                            "(0040,0242)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "eco3d"
                            },
                            "(0040,0243)" : {
                                "VR" : "SH",
                                "VM" : 0
                            },
                            "(0040,0244)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0245)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "144905"
                            },
                            "(0040,0250)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0251)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150836"
                            },
                            "(0040,0252)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "COMPLETED"
                            },
                            "(0040,0253)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "20061122.144905"
                            },
                            "(2050,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 16
                            },
                            "(2050,0020)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "IDENTITY"
                            },
                            "filename" : "/home/freddy/tmp/move/1.2.840.113663.1500.1.218819862.3.2.20061122.145416.265.dcm"
                        },
                        {
                            "(0008,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 552
                            },
                            "(0008,0008)" : {
                                "VR" : "CS",
                                "VM" : 3,
                                "value" : [
                                    "ORIGINAL",
                                    "PRIMARY",
                                    "CARDIOLOGY"
                                ]
                            },
                            "(0008,0012)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0013)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "145716"
                            },
                            "(0008,0016)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.10008.5.1.4.1.1.6.1"
                            },
                            "(0008,0018)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.113663.1500.1.218819862.3.4.20061122.145716.671"
                            },
                            "(0008,0023)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0033)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "145716"
                            },
                            "(0008,1070)" : {
                                "VR" : "PN",
                                "VM" : 1,
                                "value" : "TORNES"
                            },
                            "(0008,2111)" : {
                                "VR" : "ST",
                                "VM" : 1,
                                "value" : "Uncompressed"
                            },
                            "(0010,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 70
                            },
                            "(0010,4000)" : {
                                "VR" : "LT",
                                "VM" : 0
                            },
                            "(0018,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 484
                            },
                            "(0018,1000)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "218819862"
                            },
                            "(0018,1020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "PMS1.1 Ultrasound iE33_2.0.2.428"
                            },
                            "(0018,1030)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "Free Form"
                            },
                            "(0018,1088)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "0"
                            },
                            "(0018,5010)" : {
                                "VR" : "LO",
                                "VM" : 3,
                                "value" : [
                                    "S2",
                                    "",
                                    ""
                                ]
                            },
                            "(0018,5020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "CARD_ADULT_GEN_CV"
                            },
                            "(0020,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 172
                            },
                            "(0020,0013)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "4"
                            },
                            "(0028,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 152
                            },
                            "(0028,0002)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 3
                            },
                            "(0028,0004)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "RGB"
                            },
                            "(0028,0006)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0010)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 768
                            },
                            "(0028,0011)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1024
                            },
                            "(0028,0014)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1
                            },
                            "(0028,0100)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0101)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0102)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 7
                            },
                            "(0028,0103)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0301)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "YES"
                            },
                            "(0028,1050)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "127.0"
                            },
                            "(0028,1051)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "254.0"
                            },
                            "(0028,2110)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "00"
                            },
                            "(0040,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 230
                            },
                            "(0040,0241)" : {
                                "VR" : "AE",
                                "VM" : 1,
                                "value" : "ECO-3D"
                            },
                            "(0040,0242)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "eco3d"
                            },
                            "(0040,0243)" : {
                                "VR" : "SH",
                                "VM" : 0
                            },
                            "(0040,0244)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0245)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "144905"
                            },
                            "(0040,0250)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0251)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150836"
                            },
                            "(0040,0252)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "COMPLETED"
                            },
                            "(0040,0253)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "20061122.144905"
                            },
                            "(2050,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 16
                            },
                            "(2050,0020)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "IDENTITY"
                            },
                            "filename" : "/home/freddy/tmp/move/1.2.840.113663.1500.1.218819862.3.4.20061122.145716.671.dcm"
                        },
                        {
                            "(0008,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 552
                            },
                            "(0008,0008)" : {
                                "VR" : "CS",
                                "VM" : 3,
                                "value" : [
                                    "ORIGINAL",
                                    "PRIMARY",
                                    "CARDIOLOGY"
                                ]
                            },
                            "(0008,0012)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0013)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "145328"
                            },
                            "(0008,0016)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.10008.5.1.4.1.1.6.1"
                            },
                            "(0008,0018)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.113663.1500.1.218819862.3.1.20061122.145328.703"
                            },
                            "(0008,0023)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0033)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "145328"
                            },
                            "(0008,1070)" : {
                                "VR" : "PN",
                                "VM" : 1,
                                "value" : "TORNES"
                            },
                            "(0008,2111)" : {
                                "VR" : "ST",
                                "VM" : 1,
                                "value" : "Uncompressed"
                            },
                            "(0010,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 70
                            },
                            "(0010,4000)" : {
                                "VR" : "LT",
                                "VM" : 0
                            },
                            "(0018,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 460
                            },
                            "(0018,1000)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "218819862"
                            },
                            "(0018,1020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "PMS1.1 Ultrasound iE33_2.0.2.428"
                            },
                            "(0018,1030)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "Free Form"
                            },
                            "(0018,1088)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "0"
                            },
                            "(0018,5010)" : {
                                "VR" : "LO",
                                "VM" : 3,
                                "value" : [
                                    "S2",
                                    "",
                                    ""
                                ]
                            },
                            "(0018,5020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "CARD_ADULT_GEN_CV"
                            },
                            "(0020,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 172
                            },
                            "(0020,0013)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "1"
                            },
                            "(0028,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 152
                            },
                            "(0028,0002)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 3
                            },
                            "(0028,0004)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "RGB"
                            },
                            "(0028,0006)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0010)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 768
                            },
                            "(0028,0011)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1024
                            },
                            "(0028,0014)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1
                            },
                            "(0028,0100)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0101)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0102)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 7
                            },
                            "(0028,0103)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0301)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "YES"
                            },
                            "(0028,1050)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "127.0"
                            },
                            "(0028,1051)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "254.0"
                            },
                            "(0028,2110)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "00"
                            },
                            "(0040,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 230
                            },
                            "(0040,0241)" : {
                                "VR" : "AE",
                                "VM" : 1,
                                "value" : "ECO-3D"
                            },
                            "(0040,0242)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "eco3d"
                            },
                            "(0040,0243)" : {
                                "VR" : "SH",
                                "VM" : 0
                            },
                            "(0040,0244)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0245)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "144905"
                            },
                            "(0040,0250)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0251)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150836"
                            },
                            "(0040,0252)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "COMPLETED"
                            },
                            "(0040,0253)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "20061122.144905"
                            },
                            "(2050,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 16
                            },
                            "(2050,0020)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "IDENTITY"
                            },
                            "filename" : "/home/freddy/tmp/move/1.2.840.113663.1500.1.218819862.3.1.20061122.145328.703.dcm"
                        },
                        {
                            "(0008,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 550
                            },
                            "(0008,0008)" : {
                                "VR" : "CS",
                                "VM" : 3,
                                "value" : [
                                    "ORIGINAL",
                                    "PRIMARY",
                                    "CARDIOLOGY"
                                ]
                            },
                            "(0008,0012)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0013)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "145524"
                            },
                            "(0008,0016)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.10008.5.1.4.1.1.6.1"
                            },
                            "(0008,0018)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.113663.1500.1.218819862.3.3.20061122.145524.62"
                            },
                            "(0008,0023)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0033)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "145524"
                            },
                            "(0008,1070)" : {
                                "VR" : "PN",
                                "VM" : 1,
                                "value" : "TORNES"
                            },
                            "(0008,2111)" : {
                                "VR" : "ST",
                                "VM" : 1,
                                "value" : "Uncompressed"
                            },
                            "(0010,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 70
                            },
                            "(0010,4000)" : {
                                "VR" : "LT",
                                "VM" : 0
                            },
                            "(0018,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 484
                            },
                            "(0018,1000)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "218819862"
                            },
                            "(0018,1020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "PMS1.1 Ultrasound iE33_2.0.2.428"
                            },
                            "(0018,1030)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "Free Form"
                            },
                            "(0018,1088)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "0"
                            },
                            "(0018,5010)" : {
                                "VR" : "LO",
                                "VM" : 3,
                                "value" : [
                                    "S2",
                                    "",
                                    ""
                                ]
                            },
                            "(0018,5020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "CARD_ADULT_GEN_CV"
                            },
                            "(0020,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 172
                            },
                            "(0020,0013)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "3"
                            },
                            "(0028,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 152
                            },
                            "(0028,0002)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 3
                            },
                            "(0028,0004)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "RGB"
                            },
                            "(0028,0006)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0010)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 768
                            },
                            "(0028,0011)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1024
                            },
                            "(0028,0014)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1
                            },
                            "(0028,0100)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0101)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0102)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 7
                            },
                            "(0028,0103)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0301)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "YES"
                            },
                            "(0028,1050)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "127.0"
                            },
                            "(0028,1051)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "254.0"
                            },
                            "(0028,2110)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "00"
                            },
                            "(0040,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 230
                            },
                            "(0040,0241)" : {
                                "VR" : "AE",
                                "VM" : 1,
                                "value" : "ECO-3D"
                            },
                            "(0040,0242)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "eco3d"
                            },
                            "(0040,0243)" : {
                                "VR" : "SH",
                                "VM" : 0
                            },
                            "(0040,0244)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0245)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "144905"
                            },
                            "(0040,0250)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0251)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150836"
                            },
                            "(0040,0252)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "COMPLETED"
                            },
                            "(0040,0253)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "20061122.144905"
                            },
                            "(2050,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 16
                            },
                            "(2050,0020)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "IDENTITY"
                            },
                            "filename" : "/home/freddy/tmp/move/1.2.840.113663.1500.1.218819862.3.3.20061122.145524.62.dcm"
                        },
                        {
                            "(0008,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 550
                            },
                            "(0008,0008)" : {
                                "VR" : "CS",
                                "VM" : 3,
                                "value" : [
                                    "ORIGINAL",
                                    "PRIMARY",
                                    "CARDIOLOGY"
                                ]
                            },
                            "(0008,0012)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0013)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150057"
                            },
                            "(0008,0016)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.10008.5.1.4.1.1.6.1"
                            },
                            "(0008,0018)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.113663.1500.1.218819862.3.5.20061122.150057.62"
                            },
                            "(0008,0023)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0033)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150057"
                            },
                            "(0008,1070)" : {
                                "VR" : "PN",
                                "VM" : 1,
                                "value" : "TORNES"
                            },
                            "(0008,2111)" : {
                                "VR" : "ST",
                                "VM" : 1,
                                "value" : "Uncompressed"
                            },
                            "(0010,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 70
                            },
                            "(0010,4000)" : {
                                "VR" : "LT",
                                "VM" : 0
                            },
                            "(0018,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 460
                            },
                            "(0018,1000)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "218819862"
                            },
                            "(0018,1020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "PMS1.1 Ultrasound iE33_2.0.2.428"
                            },
                            "(0018,1030)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "Free Form"
                            },
                            "(0018,1088)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "0"
                            },
                            "(0018,5010)" : {
                                "VR" : "LO",
                                "VM" : 3,
                                "value" : [
                                    "S2",
                                    "",
                                    ""
                                ]
                            },
                            "(0018,5020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "CARD_ADULT_GEN_CV"
                            },
                            "(0020,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 172
                            },
                            "(0020,0013)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "5"
                            },
                            "(0028,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 152
                            },
                            "(0028,0002)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 3
                            },
                            "(0028,0004)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "RGB"
                            },
                            "(0028,0006)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0010)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 768
                            },
                            "(0028,0011)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1024
                            },
                            "(0028,0014)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1
                            },
                            "(0028,0100)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0101)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0102)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 7
                            },
                            "(0028,0103)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0301)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "YES"
                            },
                            "(0028,1050)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "127.0"
                            },
                            "(0028,1051)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "254.0"
                            },
                            "(0028,2110)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "00"
                            },
                            "(0040,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 230
                            },
                            "(0040,0241)" : {
                                "VR" : "AE",
                                "VM" : 1,
                                "value" : "ECO-3D"
                            },
                            "(0040,0242)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "eco3d"
                            },
                            "(0040,0243)" : {
                                "VR" : "SH",
                                "VM" : 0
                            },
                            "(0040,0244)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0245)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "144905"
                            },
                            "(0040,0250)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0251)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150836"
                            },
                            "(0040,0252)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "COMPLETED"
                            },
                            "(0040,0253)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "20061122.144905"
                            },
                            "(2050,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 16
                            },
                            "(2050,0020)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "IDENTITY"
                            },
                            "filename" : "/home/freddy/tmp/move/1.2.840.113663.1500.1.218819862.3.5.20061122.150057.62.dcm"
                        },
                        {
                            "(0008,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 552
                            },
                            "(0008,0008)" : {
                                "VR" : "CS",
                                "VM" : 3,
                                "value" : [
                                    "ORIGINAL",
                                    "PRIMARY",
                                    "CARDIOLOGY"
                                ]
                            },
                            "(0008,0012)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0013)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150247"
                            },
                            "(0008,0016)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.10008.5.1.4.1.1.6.1"
                            },
                            "(0008,0018)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.113663.1500.1.218819862.3.6.20061122.150247.390"
                            },
                            "(0008,0023)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0033)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150247"
                            },
                            "(0008,1070)" : {
                                "VR" : "PN",
                                "VM" : 1,
                                "value" : "TORNES"
                            },
                            "(0008,2111)" : {
                                "VR" : "ST",
                                "VM" : 1,
                                "value" : "Uncompressed"
                            },
                            "(0010,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 70
                            },
                            "(0010,4000)" : {
                                "VR" : "LT",
                                "VM" : 0
                            },
                            "(0018,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 484
                            },
                            "(0018,1000)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "218819862"
                            },
                            "(0018,1020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "PMS1.1 Ultrasound iE33_2.0.2.428"
                            },
                            "(0018,1030)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "Free Form"
                            },
                            "(0018,1088)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "0"
                            },
                            "(0018,5010)" : {
                                "VR" : "LO",
                                "VM" : 3,
                                "value" : [
                                    "S2",
                                    "",
                                    ""
                                ]
                            },
                            "(0018,5020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "CARD_ADULT_GEN_CV"
                            },
                            "(0020,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 172
                            },
                            "(0020,0013)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "6"
                            },
                            "(0028,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 152
                            },
                            "(0028,0002)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 3
                            },
                            "(0028,0004)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "RGB"
                            },
                            "(0028,0006)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0010)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 768
                            },
                            "(0028,0011)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1024
                            },
                            "(0028,0014)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 1
                            },
                            "(0028,0100)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0101)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 8
                            },
                            "(0028,0102)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 7
                            },
                            "(0028,0103)" : {
                                "VR" : "US",
                                "VM" : 1,
                                "value" : 0
                            },
                            "(0028,0301)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "YES"
                            },
                            "(0028,1050)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "127.0"
                            },
                            "(0028,1051)" : {
                                "VR" : "DS",
                                "VM" : 1,
                                "value" : "254.0"
                            },
                            "(0028,2110)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "00"
                            },
                            "(0040,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 230
                            },
                            "(0040,0241)" : {
                                "VR" : "AE",
                                "VM" : 1,
                                "value" : "ECO-3D"
                            },
                            "(0040,0242)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "eco3d"
                            },
                            "(0040,0243)" : {
                                "VR" : "SH",
                                "VM" : 0
                            },
                            "(0040,0244)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0245)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "144905"
                            },
                            "(0040,0250)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0251)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150836"
                            },
                            "(0040,0252)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "COMPLETED"
                            },
                            "(0040,0253)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "20061122.144905"
                            },
                            "(2050,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 16
                            },
                            "(2050,0020)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "IDENTITY"
                            },
                            "filename" : "/home/freddy/tmp/move/1.2.840.113663.1500.1.218819862.3.6.20061122.150247.390.dcm"
                        }
                    ]
                },
                {
                    "(0008,0021)" : {
                        "VR" : "DA",
                        "VM" : 1,
                        "value" : "20061122"
                    },
                    "(0008,0031)" : {
                        "VR" : "TM",
                        "VM" : 1,
                        "value" : "144905"
                    },
                    "(0008,0060)" : {
                        "VR" : "CS",
                        "VM" : 1,
                        "value" : "SR"
                    },
                    "(0008,0070)" : {
                        "VR" : "LO",
                        "VM" : 1,
                        "value" : "Philips Medical Systems"
                    },
                    "(0008,0080)" : {
                        "VR" : "LO",
                        "VM" : 1,
                        "value" : "CMDAT  Dr. S. ALLENDE"
                    },
                    "(0008,1010)" : {
                        "VR" : "SH",
                        "VM" : 1,
                        "value" : "eco3d"
                    },
                    "(0008,1090)" : {
                        "VR" : "LO",
                        "VM" : 1,
                        "value" : "iE33"
                    },
                    "(0020,000e)" : {
                        "VR" : "UI",
                        "VM" : 1,
                        "value" : "1.2.840.113663.1500.1.218819862.7.1.20061122.144905.562"
                    },
                    "(0020,0011)" : {
                        "VR" : "IS",
                        "VM" : 1,
                        "value" : "2"
                    },
                    "instances" : [
                        {
                            "(0008,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 468
                            },
                            "(0008,0016)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.10008.5.1.4.1.1.88.33"
                            },
                            "(0008,0018)" : {
                                "VR" : "UI",
                                "VM" : 1,
                                "value" : "1.2.840.113663.1500.1.218819862.8.3.20061122.150837.906"
                            },
                            "(0008,0023)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0008,0033)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150837"
                            },
                            "(0008,1070)" : {
                                "VR" : "PN",
                                "VM" : 1,
                                "value" : "TORNES"
                            },
                            "(0010,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 70
                            },
                            "(0010,4000)" : {
                                "VR" : "LT",
                                "VM" : 0
                            },
                            "(0018,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 76
                            },
                            "(0018,1000)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "218819862"
                            },
                            "(0018,1020)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "PMS1.1 Ultrasound iE33_2.0.2.428"
                            },
                            "(0018,1030)" : {
                                "VR" : "LO",
                                "VM" : 1,
                                "value" : "Free Form"
                            },
                            "(0020,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 172
                            },
                            "(0020,0013)" : {
                                "VR" : "IS",
                                "VM" : 1,
                                "value" : "3"
                            },
                            "(0040,0000)" : {
                                "VR" : "UL",
                                "VM" : 1,
                                "value" : 40906
                            },
                            "(0040,0241)" : {
                                "VR" : "AE",
                                "VM" : 1,
                                "value" : "ECO-3D"
                            },
                            "(0040,0242)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "eco3d"
                            },
                            "(0040,0243)" : {
                                "VR" : "SH",
                                "VM" : 0
                            },
                            "(0040,0244)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0245)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "144905"
                            },
                            "(0040,0250)" : {
                                "VR" : "DA",
                                "VM" : 1,
                                "value" : "20061122"
                            },
                            "(0040,0251)" : {
                                "VR" : "TM",
                                "VM" : 1,
                                "value" : "150836"
                            },
                            "(0040,0252)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "COMPLETED"
                            },
                            "(0040,0253)" : {
                                "VR" : "SH",
                                "VM" : 1,
                                "value" : "20061122.144905"
                            },
                            "(0040,a040)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "CONTAINER"
                            },
                            "(0040,a050)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "SEPARATE"
                            },
                            "(0040,a491)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "PARTIAL"
                            },
                            "(0040,a493)" : {
                                "VR" : "CS",
                                "VM" : 1,
                                "value" : "UNVERIFIED"
                            },
                            "filename" : "/home/freddy/tmp/move/1.2.840.113663.1500.1.218819862.8.3.20061122.150837.906.dcm"
                        }
                    ]
                }
            ]
        }
    ]
}

how can I execute this king of query????

db.patients.update(
{
    "(0010,0010).value":{$regex:"ada", $options:"i"},
    "studies.(0020,000d).value":{$regex:"1",$options:"i"},
{
    $push : {"studies.$.(0020,000d).series.$.(0020,000e).value": "cambiando dato"}
})

best regards

freddy

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Qingping | 24 May 2013 18:06
Picon
Gravatar

does findandmodify block the entire instance just the database it's issued upon

as the subject states, does findandmodify block the entire instance just the database it's issued upon ? 

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
demirtas | 24 May 2013 17:00

Can't I push sub-document in update method (PHP)

Hello everybody,


How Can I push to sub-document in update  ?,

I wrote some code, but not the way I want.

My code :

INSERT CODE :

$collection->insert(
                        array(
                                "namespace" => "test",
                                "age" => 20,
                                "contact" => array("hotmail" => "test-PkbjNfxxIARyhfBGqJeJzQ@public.gmane.org", "gmail" => "test-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org")
                             )
        );


UPDATE CODE :

$update_result = $update = $collection->update(
                                array("namespace" => "test"),
                                array(
                                        '$addToSet' => array("contact.web" => "test-J0of1frlU80@public.gmane.org")
                                     ),
                               
                                 array("upsert" => true)
                              );

var_dump($update_result);

array(4) { ["_id"]=> object(MongoId)#6 (1) { ["$id"]=> string(24) "519f7cd1b824e6ab0c340933" } ["namespace"]=> string(4) "test" ["contact"]=> array(3) { ["gmail"]=> string(14) "test-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" ["hotmail"]=> string(19) "test-PkbjNfxxIARyhfBGqJeJzQ@public.gmane.org" ["web"]=> array(1) { // Record has been added as an array, I want add record to old array [0]=> string(13) "test-J0of1frlU80@public.gmane.org" } } ["age"]=> int(20) }

I want this result;



array(4) { ["_id"]=> object(MongoId)#6 (1) { ["$id"]=> string(24) "519f7cd1b824e6ab0c340933" } ["namespace"]=> string(4) "test" ["contact"]=> array(3) { ["gmail"]=> string(14) "test-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" ["hotmail"]=> string(19) "test-PkbjNfxxIARyhfBGqJeJzQ@public.gmane.org" ["web"]=> string(13) "test-J0of1frlU80@public.gmane.org" } ["age"]=> int(20) }  
I'm sorry bad english language, you are understand my problem from my says :)  ?

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
ben griffiths | 24 May 2013 15:56
Picon

Odd behaviour of 2dsphere index

Hi all,


I'm seeing some strange behaviour with the new 2dsphere index. In my real case I have around 80,000,000 records and a compound index of 2dsphere and insert time in reverse order (to allow sorting). The query I am trying to run is something like "get me the last 100 results in this area where some other values are true".

This works great when the area is large and contains lots of results but fails badly when the area contains no results, it seems to cause a scan of the whole dataset.

I can reproduce this in a simpler manner using the following set up;

var i = 0, lat = 0, lng = 0;
for (i; i < 500000; i++) {
  lat = parseFloat(Math.min(-90 + (Math.random() * 180), 90).toFixed(6));
  lng = parseFloat(Math.min(-90 + (Math.random() * 180), 90).toFixed(6));
  db.events.insert({latlng: [lat, lng]}, function () {});
}

db.events.ensureIndex({"latlng" : "2dsphere");

db.events.find({"latlng" : { $geoWithin : { $center : [ [-90, -90 ], 10 ] } }}).limit(50).forEach(function(){}) // finds results

takes 32 milliseconds

where

db.events.find({"latlng" : { $geoWithin : { $center : [ [-150, -150 ], 10 ] } }}).limit(50).forEach(function(){})  // no results in query area

takes 910 milliseconds.

Scale this up a large dataset and it's a very big problem!

What I've also found is that the old "2d" index doesn't have this issue. Unfortunately I need a compound index for sorting so I'm forced to use the 2dsphere index (I'm similarly restricted from using the haystack index)

Any ideas? Is this a bug? Expected behaviour? 

Thanks for your time reading this,

Ben

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Arthur Almeida Pereira | 24 May 2013 15:37
Picon

Easy way to add field in array of objects

Hello, 

  This is an example of document:

  { 
    name : "abc",
    values : [
      { size : 1, height : 10 }, { size : 2, height : 12 }, { size : 3, height : 30 }
    ]
  }

  I want to add the field "width" to all objects inside the array values.
  I created a script that iterates over the collection and add the field in each object in array and update each document.
  There is another way to do that? With a simple db.collection.update() ?

cheers,  


Neuwald Tecnologia da Informação

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
LiangQing | 24 May 2013 13:29
Picon
Gravatar

Secondary of replica set can not complete sync up

Hi all, 

I had set up a replica set with three members: one primary, one secondary, one arbiter. And they work well before.

Today, i want to migrate the secondary to another host, so i remove the secondary from my replica set, and shutdown it, then i copy the data directory to the new host, this cost about two hours.

After that, i add the new host to the replica set, and it becomes a secondary

But the new secondary can not complete the sync up, its optime don't change, and I find error in the new secondary's log file:

Fri May 24 16:31:34.688 [rsBackgroundSync] Socket recv() timeout  bgl-fb02:27017
Fri May 24 16:31:34.688 [rsBackgroundSync] SocketException: remote: bgl-fb02:27017 error: 9001 socket exception [3] server [bgl-fb02:27017]
Fri May 24 16:31:34.688 [rsBackgroundSync] DBClientCursor::init call() failed
Fri May 24 16:31:34.689 [rsBackgroundSync] replSet db exception in producer: 10276 DBClientBase::findN: transport error: bgl-fb02:27017 ns: local.oplog.rs query: {}

And find some error in the primary's log file:

Fri May 24 16:30:28.844 [conn1568] query local.oplog.rs query: { ts: { $gte: Timestamp 1369363889000|64 } } cursorid:34991129499321807 ntoreturn:0 ntoskip:0 nscanned:102 keyUpdates:0 numYields: 14084 locks(micros) r:2436164 nreturned:101 reslen:10084 174167ms

The local.oplog.rs of primary is very large, 28304977 records, so i think the slow query of the local.oplog.rs caused the syncing issue of secondary, is that right? and how can i fix it?

here is the rs.status():
   {
     "set": "rs0",
     "date": "2013-05-24T04:55:04.000Z",
     "myState": 1,
     "members": [
       {
         "_id": 0,
         "name": "bgl-fb02:27017",
         "health": 1,
         "state": 1,
         "stateStr": "PRIMARY",
         "uptime": 1891429,
         "optime": {
           "t": 1369370981,
           "i": 44
         },
         "optimeDate": "2013-05-24T04:49:41.000Z",
         "self": true
       },
       {
         "_id": 2,
         "name": "bgl-fishbowl1:27017",
         "health": 1,
         "state": 7,
         "stateStr": "ARBITER",
         "uptime": 1371,
         "lastHeartbeat": "2013-05-24T04:55:04.000Z",
         "lastHeartbeatRecv": "1970-01-01T00:00:00.000Z",
         "pingMs": 0
       },
       {
         "_id": 4,
         "name": "bgl-fb18:27017",
         "health": 1,
         "state": 2,
         "stateStr": "SECONDARY",
         "uptime": 1371,
         "optime": {
           "t": 1369363889,
           "i": 64
         },
         "optimeDate": "2013-05-24T02:51:29.000Z",
         "lastHeartbeat": "2013-05-24T04:55:04.000Z",
         "lastHeartbeatRecv": "1970-01-01T00:00:00.000Z",
         "pingMs": 0,
         "lastHeartbeatMessage": "syncing to: bgl-fb02:27017"
       }
     ],
     "ok": 1
   }

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Michael Inden | 24 May 2013 13:23
Picon

Mongo DB hangs for ever (when calling dropDatabase() during a long running query/aggregation)

I started a rellay long running query/aggregation (> 1 h) and i wanted to stop this.
So i decided to call  db.dropDatabase() from the mongo console.
The server replied that the datase has succesfuly been dropped but reports errors
in the server console window.
 
After that action all follwing calls from the mongo console aren't executed / run forever.
Several restarts of the mongo console have shown no effect.
It seems that the mongo server is in an unexpected state and can't recover from there.
 
So i tryed to call repairDatabase() from the mongo console, but the command isn't executed --
console hangs (as described above).
 
The i tryed to stop the server by pressing Ctrl+C. Server recognized that it should stop, but
isn't shut down. So i am forced to kill the mongo db server process. 
 
Any ideas who you can recover when db.dropDatabase() succeds and following
commands won't be executed?
 
ThX for your help,
Michael

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Michael Inden | 24 May 2013 14:23
Picon

Mongo DB not responding / hangs forever after calling dropDatabase() (during a long running query/aggregation)

I started a long runnoing query/aggregation (> 1 h) and i wanted to stop the execution.
So i executed db.dropDatabase() in the mongo console inorder to stop the query.
I received an answer that dropDatabase() succeded.
But in the console window of the mogo db server a saw some error messages
saying an internal error may have occured. The server won^'t recover
from this problem.
 
After the sever don't respond to commands . Any command that i
enter in the mogo console hangs. I restarted the mongo console
several times but nothing changes -- the server still hangs.
 
Then I tried to stop the sever using Ctrl+C. The server tries to
shut down but fails. So i'm forced to kill the process manually.
 
2 questions:
 
1) How can i stop a long running query without getting in problems?
2) Why can't the server recover from the situation described above?
 
ThX for your answers and help
Michael
 

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
TJ Tang | 24 May 2013 15:25
Picon

Why mongo taks 15 seconds to update a record?

I'm reviewing the mongo profiling data and noticed that there is one update job took nearly 15 seconds. The code was trying to update some user data in the User collection which has about 120K entries. 


Here's the profile output:

{
"ts" : ISODate("2013-05-24T12:59:44.610Z"),
"op" : "update",
"ns" : "gf2.User",
"query" : {
"_id" : "gfu-iqckom"
},
"updateobj" : {
"$set" : {
"random" : [
0.040397967884538866,
0.9845285429580969
],
"games" : [
{
"name" : "xxxxxx.com",
"trophies" : [
{
"date" : 1369322506.962343,
"id" : "welcome"
},
{
"date" : 1369323539.185573,
"id" : "fb_connect"
}
]
},
{
"timestamp" : 1369400360,
"data" : {
"create_tm" : 1369400360.618168
},
"name" : "xxxxxx"
}
],
"update_tm" : 1369400360.618263
}
},
"nscanned" : 1,
"moved" : true,
"nmoved" : 1,
"nupdated" : 1,
"keyUpdates" : 0,
"numYield" : 0,
"lockStats" : {
"timeLockedMicros" : {
"r" : NumberLong(0),
"w" : NumberLong(14833109)
},
"timeAcquiringMicros" : {
"r" : NumberLong(0),
"w" : NumberLong(2985)
}
},
"millis" : 14833,
"client" : "10.0.0.12",
"user" : ""
}


And the stats for the relevant collection:

rssh1:PRIMARY> db.User.stats()
{
"ns" : "gf2.User",
"count" : 125872,
"size" : 1421237056,
"avgObjSize" : 11291.129528409812,
"storageSize" : 9082679280,
"numExtents" : 23,
"nindexes" : 7,
"lastExtentSize" : 2146426864,
"paddingFactor" : 1.020000001594492,
"systemFlags" : 0,
"userFlags" : 0,
"totalIndexSize" : 2016168896,
"indexSizes" : {
"_id_" : 5338928,
"user_id_1" : 5486096,
"fbID_1" : 5052768,
"email_1" : 7113120,
"tags.facebook_friends_1" : 1980783168,
"games.name" : 11307408,
"random" : 1087408
},
"ok" : 1
}

This mongod is the primary of the 2 nodes replica set(including one arbiter node). The secondary is currently in the resync process. The client code is using pymongo and the write concern level is only on the Primary, i.e., it should return without having to wait for the data to be replicated. 

 What could be the possible reasons a write could take up so much time?  



--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Ravan | 24 May 2013 14:03
Picon

MongoDB JDBC Driver Connectivity Details

Hi Everyone,


I would like to acess mongodb from a tool named Rapidminer
While managing a connection
1) Downloaded MongoDB JDBC Driver and browsed the same
2) Needed the following details 
  •     URL prefix
  •    Schema separator
  •    Driver class 


Please help me on this ...
Thanks,
Ravan





--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gmane