Files
mongo/jstests/core/capped/capped_upsert.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

16 lines
446 B
JavaScript

/**
* Tests upserting into a capped collection with deletes needed.
*
* @tags: [
* requires_capped,
* # Capped collections cannot be sharded
* assumes_unsharded_collection,
* ]
*/
const coll = db[jsTestName()];
coll.drop();
assert.commandWorked(db.createCollection(coll.getName(), {capped: true, size: 100000, max: 1}));
assert.commandWorked(coll.insert({text: "a"}));
assert.commandWorked(coll.save({_id: 123, text: "b"}));