Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3382

array index field name does not work for an array within an array

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Index Maintenance, Querying
    • None
    • Fully Compatible

    Description

      > c.drop()
      true
      > c.save( {a:[[5]]} );
      > c.save( {a:[{'0':5}]} );
      > c.count( {'a.0':5} )
      1

      Would it make sense for the first doc to match as well as the second? Changing this may require a key generation change.

      Here's something else that's a bit strange:

      > c.drop();
      true
      > c.save( {a:[[1]]} )
      > c.find( {'a.0':1} )
      > c.save( {a:[[{b:1}]]} )
      > c.find( {'a.0.b':1} )
      { "_id" : ObjectId("4e154cf00157217a5f5f2989"), "a" : [ [ { "b" : 1 } ] ] }
      > 

      Attachments

        Activity

          People

            david.storch@mongodb.com David Storch
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: