find BinData without new Shell

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.0.2
    • Component/s: JavaScript
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Create simple bin data:

      > db.uuid.save({_id : new BinData(3, "Y0pfMW5Mb2pT1uz5+u1Ckw==")})
      > db.uuid.save({_id : new BinData(3, "okiGox+XG637qdDet1rinw==")})

      Correct: An example that correctly returns the document:

      > db.uuid.find({_id : new BinData(3, "okiGox+XG637qdDet1rinw==")})

      Error: If I forget the "new" then instead of zero docs I get all records:

      > db.uuid.find({_id : BinData(3, "okiGox+XG637qdDet1rinw==")})

      { "_id" : BinData(3,"Y0pfMW5Mb2pT1uz5+u1Ckw==") } { "_id" : BinData(3,"okiGox+XG637qdDet1rinw==") }

              Assignee:
              Unassigned
              Reporter:
              Chris Harris (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: