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

findandmodify positional operator $ in C++ driver

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 1.6.0
    • Internal Client
    • None
    • Ubuntu 10.1,
    • ALL

    Description

      Seems to be related to this issue:" findandmodify doesn't support positional ($) operator" => http://jira.mongodb.org/browse/SERVER-1095

      When I attempt to execute a positional set operation, the following error is emitted on the console: (with same example as linked).

      update EXAMPLE_ARRAY query:

      { _id: ObjectId('4c6a7075c42868719b80c2e1') }

      byid exception 13048 can't append to array using string field name [$] 0ms

      It works fine when I use the console. My find-and-modify command is as follows:

      BSONObjBuilder b;
      b << "findandmodify" << collection_name.c_str() <<
      "query" << Query(query) <<
      "update" << update <<
      "new" << see_modified;

      bool result = dbcb->runCommand(string(MONGO_DBNAME),
      b.obj(),
      rtn);

      The query phase works perfectly well.

      Attachments

        Activity

          People

            mathias@mongodb.com Mathias Stearn
            m.savy m savy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: