GitHub PullRequestReviewCommentEvent at 2014-05-21 17:49:31
Repository: mongo-cxx-driver
Actor: TylerBrock
Payload: {"comment":{"url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/comments/12910348","id":12910348,"diff_hunk":"@@ -0,0 +1,72 @@\n+/*    Copyright 2014 MongoDB Inc.\n+ *\n+ *    Licensed under the Apache License, Version 2.0 (the \"License\");\n+ *    you may not use this file except in compliance with the License.\n+ *    You may obtain a copy of the License at\n+ *\n+ *    http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ *    Unless required by applicable law or agreed to in writing, software\n+ *    distributed under the License is distributed on an \"AS IS\" BASIS,\n+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ *    See the License for the specific language governing permissions and\n+ *    limitations under the License.\n+ */\n+\n+#pragma once\n+\n+#include \"mongo/bson/bsonobj.h\"\n+\n+namespace mongo {\n+\n+    class BulkOperationBuilder;\n+\n+    /**\n+     * Class for constructing bulk write operations which have an applied filter\n+     * and are to be performed as an upsert.\n+     *\n+     * Not to be instantiated directly. Comes into being via the upsert() method on\n+     * BulkWriteOperation.\n+     */\n+    class BulkUpsertOperation {\n+    public:\n+\n+        /**\n+         * BulkUpsertOperation constructor\n+         *\n+         * @param builder BulkOperationBuilder where terminal operations will be enqueued.\n+         * @param selector Filter describing subset of documents to which this op will apply.\n+         */\n+        BulkUpsertOperation(BulkOperationBuilder* const builder, const BSONObj& selector);\n+\n+        /**\n+         * Enqueues an operation which updates a single document matching _selector by\n+         * applying the supplied update document. If no matching document exists, the\n+         * operation becomes an insert.\n+         *\n+         * @param update The update to apply to matching documents.\n+         */\n+        void updateOne(const BSONObj& update);\n+\n+        /**\n+         * Enqueues an operation which updates any document matching _selector by applying\n+         * the supplied update document. If no matching document exists, the operation\n+         * becomes an insert.\n+         *\n+         * @param update The update to apply to matching documents.\n+         */\n+        void update(const BSONObj& update);\n+\n+        /**\n+         * Enqueues an operation which replaces a single document matching _selector\n+         * with the supplied replacement. If no matching document exists, the operation\n+         * becomes an insert.\n+         */\n+        void replaceOne(const BSONObj& replacement);\n+\n+    private:\n+        BulkOperationBuilder* const _builder;\n+        const BSONObj _selector;\n+    };\n+\n+}","path":"src/mongo/client/bulk_upsert_operation.h","position":72,"original_position":72,"commit_id":"69491c69bd2775be3d1bdfa31cbcbe2bd4dceee5","original_commit_id":"69491c69bd2775be3d1bdfa31cbcbe2bd4dceee5","user":{"login":"TylerBrock","id":280807,"avatar_url":"https://avatars.githubusercontent.com/u/280807?","gravatar_id":"c191b7663bac34a35bba3d096712c3c1","url":"https://api.github.com/users/TylerBrock","html_url":"https://github.com/TylerBrock","followers_url":"https://api.github.com/users/TylerBrock/followers","following_url":"https://api.github.com/users/TylerBrock/following{/other_user}","gists_url":"https://api.github.com/users/TylerBrock/gists{/gist_id}","starred_url":"https://api.github.com/users/TylerBrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TylerBrock/subscriptions","organizations_url":"https://api.github.com/users/TylerBrock/orgs","repos_url":"https://api.github.com/users/TylerBrock/repos","events_url":"https://api.github.com/users/TylerBrock/events{/privacy}","received_events_url":"https://api.github.com/users/TylerBrock/received_events","type":"User","site_admin":false},"body":":ok: : ","created_at":"2014-05-21T17:49:31Z","updated_at":"2014-05-21T17:49:31Z","html_url":"https://github.com/mongodb/mongo-cxx-driver/pull/79#discussion_r12910348","pull_request_url":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/79","_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/comments/12910348"},"html":{"href":"https://github.com/mongodb/mongo-cxx-driver/pull/79#discussion_r12910348"},"pull_request":{"href":"https://api.github.com/repos/mongodb/mongo-cxx-driver/pulls/79"}}}}