diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
| commit | 4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch) | |
| tree | 1682a647d4463397c119183369ae6f750d5fdcff /jstests/sharding/documents_db_not_exist.js | |
| parent | aa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff) | |
| parent | 8f0827553e09872941945a093b647a4211a9db7f (diff) | |
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0'
with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'jstests/sharding/documents_db_not_exist.js')
| -rw-r--r-- | jstests/sharding/documents_db_not_exist.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/jstests/sharding/documents_db_not_exist.js b/jstests/sharding/documents_db_not_exist.js deleted file mode 100644 index 1742d149516..00000000000 --- a/jstests/sharding/documents_db_not_exist.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Tests that $documents stage continues even when the database does not exist - * @tags: [requires_fcv_62, multiversion_incompatible] - * - */ - -(function() { -"use strict"; - -let st = new ShardingTest({shards: 3}); - -function listDatabases(options) { - return assert.commandWorked(st.s.adminCommand(Object.assign({listDatabases: 1}, options))) - .databases; -} - -function createAndDropDatabase(dbName) { - // Create the database. - let db = st.s.getDB(dbName); - assert.commandWorked(db.foo.insert({})); - // Confirms the database exists. - assert.eq(1, listDatabases({nameOnly: true, filter: {name: dbName}}).length); - // Drop the database - assert.commandWorked(db.dropDatabase()); - // Confirm the database is dropped. - assert.eq(0, listDatabases({nameOnly: true, filter: {name: dbName}}).length); - return db; -} - -// $documents stage evaluates to an array of objects. -let db = createAndDropDatabase("test"); -let documents = []; -for (let i = 0; i < 50; i++) { - documents.push({_id: i}); -} -let result = db.aggregate([{$documents: documents}]); -assert(result.toArray().length == 50); - -//$documents stage evaluates to an array of objects in a pipeline -db = createAndDropDatabase("test2"); -result = db.aggregate([ - {$documents: [{_id: 1, size: "medium"}, {_id: 2, size: "large"}]}, - {$match: {size: "medium"}} -]); -assert(result.toArray().length == 1); - -st.stop(); -})(); |
