mongoc_collection_save doesn't insert documents with user set id's

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 0.90.0
    • Component/s: None
    • None
    • Environment:
      Ubuntu 12, Mongo 2.4.8
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Follow the semantics on http://docs.mongodb.org/manual/reference/method/db.collection.save/

      Save should upsert the document if it already has an id (currently uses MONGOC_UPDATE_NONE instead of MONGOC_UPDATE_UPSERT)

      Also save should replace the document entirely and not $set fields

      I attached an untested version of mongoc_collection_save that I think should work.

        1. save.c
          1 kB
          Matthew Wilkinson

            Assignee:
            Unassigned
            Reporter:
            Matthew Wilkinson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: