Sha256: 54de48f0c1b856dffc76c5348237d10b72d2ca2bd4ea9098ee3dc1a0bf951248

Contents?: true

Size: 1.43 KB

Versions: 6

Compression:

Stored size: 1.43 KB

Contents

data:
    - {_id: 1, x: 11}
    - {_id: 2, x: 22}
    - {_id: 3, x: 33}
minServerVersion: '2.6'
# See SERVER-5289 for why the collection data is only checked for server versions >= 2.6

tests:
    -
        description: "FindOneAndReplace when no documents match with upsert returning the document before modification"
        operation:
            name: findOneAndReplace
            arguments:
                filter: {_id: 4}
                replacement: {x: 44}
                projection: {x: 1, _id: 0}
                sort: {x: 1}
                upsert: true

        outcome:
            result: null
            collection:
                data:
                    - {_id: 1, x: 11}
                    - {_id: 2, x: 22}
                    - {_id: 3, x: 33}
                    - {_id: 4, x: 44}
    -
        description: "FindOneAndReplace when no documents match with upsert returning the document after modification"
        operation:
            name: findOneAndReplace
            arguments:
                filter: {_id: 4}
                replacement: {x: 44}
                projection: {x: 1, _id: 0}
                returnDocument: After
                sort: {x: 1}
                upsert: true

        outcome:
            result: {x: 44}
            collection:
                data:
                    - {_id: 1, x: 11}
                    - {_id: 2, x: 22}
                    - {_id: 3, x: 33}
                    - {_id: 4, x: 44}

Version data entries

6 entries across 5 versions & 2 rubygems

Version Path
tdiary-5.0.5 vendor/bundle/gems/mongo-2.4.1/spec/support/crud_tests/write/findOneAndReplace-upsert.yml
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongo-2.4.1/spec/support/crud_tests/write/findOneAndReplace-upsert.yml
tdiary-5.0.4 vendor/bundle/gems/mongo-2.4.1/spec/support/crud_tests/write/findOneAndReplace-upsert.yml
mongo-2.4.1 spec/support/crud_tests/write/findOneAndReplace-upsert.yml
mongo-2.4.0 spec/support/crud_tests/write/findOneAndReplace-upsert.yml
mongo-2.4.0.rc1 spec/support/crud_tests/write/findOneAndReplace-upsert.yml