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

Add collation parameter to shell helpers

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.8
    • Affects Version/s: None
    • Component/s: Querying, Shell
    • None
    • Fully Compatible
    • Query 16 (06/24/16)

      Collection creation:

      db.createCollection("myColl", {collation: {...}});
      

      Index creation:

      db.coll.ensureIndex({key: 1, pattern: 1}, {collation: {...}});
      db.coll.createIndex({key: 1, pattern: 1}, {collation: {...}});
      db.coll.createIndexes([{key: 1}, {pattern: 1}], {collation: {...}});
      

      Operations:

      db.coll.find().collation({...});
      db.coll.find().collation({...}).count();
      db.coll.aggregate([..], {collation: {...}});
      db.coll.distinct(<key>, <predicate>, {collation: {...}});
      db.coll.findAndModify({<update|remove>: ..., collation: {...});
      db.coll.group({
      key: ...,
      reduce: ...,
      initial: ...,
      collation: {...}
      });
      db.coll.mapReduce(<map>, <reduce>, {collation: {...}});
      db.coll.remove(<predicate>, {collation: {...}});
      db.coll.update(<predicate>, <mods>, {collation: {...}});
      

      (Note that geoNear is omitted because it does not have a shell helper.)

      CRUD API:

      db.coll.bulkWrite([
          {updateOne: {..., collation: {...}}},
          {updateMany: {..., collation: {...}}},
          {replaceOne: {..., collation: {...}}},
          {deleteOne: {..., collation: {...}}},
          {deleteMany: {..., collation: {...}}}
      ]);
      db.coll.deleteOne(<filter>, {collation: {...}});
      db.coll.deleteMany(<filter>, {collation: {...}});
      db.coll.findOneAndDelete(<filter>, {collation: {...}});
      db.coll.findOneAndReplace(
      <filter>, <replacement>, {collation: {...}}
      );
      db.coll.findOneAndUpdate(
      <filter>, <update>, {collation: {...}}
      );
      db.coll.replaceOne(<filter>, <replacement>, {collation: {...}});
      db.coll.updateOne(<filter>, <update>, {collation: {...}});
      db.coll.updateMany(<filter>, <update>, {collation: {...}});
      

      Bulk write API:

      var bulk = db.coll.initializeUnorderedBulkOp();
      bulk.find({...}).collation({...});
      bulk.execute();
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: