From 2e91e8262b29e1df73576be17f1e49ab3a75f6cc Mon Sep 17 00:00:00 2001 From: Joy Kim Date: Thu, 5 Dec 2024 13:40:48 -0500 Subject: [PATCH 1/3] Remove deprecated field from GridFS unified tests --- .../unified-test-format/gridfs/delete.json | 1006 ++++++++--------- .../unified-test-format/gridfs/download.json | 660 ++++++----- .../gridfs/downloadByName.json | 381 +++---- .../unified-test-format/gridfs/upload.json | 719 ++++++------ 4 files changed, 1302 insertions(+), 1464 deletions(-) diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/delete.json b/driver-core/src/test/resources/unified-test-format/gridfs/delete.json index 7a4ec27f887..14bc4f8cc7f 100644 --- a/driver-core/src/test/resources/unified-test-format/gridfs/delete.json +++ b/driver-core/src/test/resources/unified-test-format/gridfs/delete.json @@ -1,301 +1,280 @@ { - "description": "gridfs-delete", - "schemaVersion": "1.0", - "createEntities": [ + "description" : "gridfs-delete", + "schemaVersion" : "1.0", + "createEntities" : [ { - "client": { - "id": "client0" + "client" : { + "id" : "client0" } }, { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" + "database" : { + "id" : "database0", + "client" : "client0", + "databaseName" : "gridfs-tests" } }, { - "bucket": { - "id": "bucket0", - "database": "database0" + "bucket" : { + "id" : "bucket0", + "database" : "database0" } }, { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" + "collection" : { + "id" : "bucket0_files_collection", + "database" : "database0", + "collectionName" : "fs.files" } }, { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" + "collection" : { + "id" : "bucket0_chunks_collection", + "database" : "database0", + "collectionName" : "fs.chunks" } } ], - "initialData": [ + "initialData" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "length-0", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "length-0-with-empty-chunk", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000003" + "_id" : { + "$oid" : "000000000000000000000003" }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" + "length" : 2, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "length-2", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000004" + "_id" : { + "$oid" : "000000000000000000000004" }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" + "length" : 8, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" }, - "md5": "dd254cdc958e53abaa67da9f797125f5", - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "length-8", + "metadata" : {} } ] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "files_id": { - "$oid": "000000000000000000000002" + "files_id" : { + "$oid" : "000000000000000000000002" }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "files_id": { - "$oid": "000000000000000000000003" + "files_id" : { + "$oid" : "000000000000000000000003" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESI=", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000003" + "_id" : { + "$oid" : "000000000000000000000003" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000004" + "_id" : { + "$oid" : "000000000000000000000004" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" + "n" : 1, + "data" : { + "$binary" : { + "base64" : "VWZ3iA==", + "subType" : "00" } } } ] } ], - "tests": [ + "tests" : [ { - "description": "delete when length is 0", - "operations": [ + "description" : "delete when length is 0", + "operations" : [ { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000001" + "name" : "delete", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000001" } } } ], - "outcome": [ + "outcome" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000002" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0-with-empty-chunk", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000003" + }, + "length" : 2, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-2", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "dd254cdc958e53abaa67da9f797125f5", - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000004" + }, + "length" : 8, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-8", + "metadata" : {} } ] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "files_id": { - "$oid": "000000000000000000000002" + "files_id" : { + "$oid" : "000000000000000000000002" }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "files_id": { - "$oid": "000000000000000000000003" + "files_id" : { + "$oid" : "000000000000000000000003" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESI=", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000003" + "_id" : { + "$oid" : "000000000000000000000003" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000004" + "_id" : { + "$oid" : "000000000000000000000004" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" + "n" : 1, + "data" : { + "$binary" : { + "base64" : "VWZ3iA==", + "subType" : "00" } } } @@ -304,116 +283,107 @@ ] }, { - "description": "delete when length is 0 and there is one extra empty chunk", - "operations": [ + "description" : "delete when length is 0 and there is one extra empty chunk", + "operations" : [ { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000002" + "name" : "delete", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000002" } } } ], - "outcome": [ + "outcome" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000001" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000003" + }, + "length" : 2, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-2", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "dd254cdc958e53abaa67da9f797125f5", - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000004" + }, + "length" : 8, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-8", + "metadata" : {} } ] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "files_id": { - "$oid": "000000000000000000000003" + "files_id" : { + "$oid" : "000000000000000000000003" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESI=", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000003" + "_id" : { + "$oid" : "000000000000000000000003" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000004" + "_id" : { + "$oid" : "000000000000000000000004" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" + "n" : 1, + "data" : { + "$binary" : { + "base64" : "VWZ3iA==", + "subType" : "00" } } } @@ -422,101 +392,92 @@ ] }, { - "description": "delete when length is 8", - "operations": [ + "description" : "delete when length is 8", + "operations" : [ { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000004" + "name" : "delete", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000004" } } } ], - "outcome": [ + "outcome" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000001" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000002" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0-with-empty-chunk", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000003" + }, + "length" : 2, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-2", + "metadata" : {} } ] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "files_id": { - "$oid": "000000000000000000000002" + "files_id" : { + "$oid" : "000000000000000000000002" }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "files_id": { - "$oid": "000000000000000000000003" + "files_id" : { + "$oid" : "000000000000000000000003" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESI=", + "subType" : "00" } } } @@ -525,149 +486,137 @@ ] }, { - "description": "delete when files entry does not exist", - "operations": [ + "description" : "delete when files entry does not exist", + "operations" : [ { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000000" + "name" : "delete", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000000" } }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ], - "outcome": [ + "outcome" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000001" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000002" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0-with-empty-chunk", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000003" + }, + "length" : 2, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-2", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "dd254cdc958e53abaa67da9f797125f5", - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000004" + }, + "length" : 8, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-8", + "metadata" : {} } ] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "files_id": { - "$oid": "000000000000000000000002" + "files_id" : { + "$oid" : "000000000000000000000002" }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "files_id": { - "$oid": "000000000000000000000003" + "files_id" : { + "$oid" : "000000000000000000000003" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESI=", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000003" + "_id" : { + "$oid" : "000000000000000000000003" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000004" + "_id" : { + "$oid" : "000000000000000000000004" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" + "n" : 1, + "data" : { + "$binary" : { + "base64" : "VWZ3iA==", + "subType" : "00" } } } @@ -676,118 +625,109 @@ ] }, { - "description": "delete when files entry does not exist and there are orphaned chunks", - "operations": [ + "description" : "delete when files entry does not exist and there are orphaned chunks", + "operations" : [ { - "name": "deleteOne", - "object": "bucket0_files_collection", - "arguments": { - "filter": { - "_id": { - "$oid": "000000000000000000000004" + "name" : "deleteOne", + "object" : "bucket0_files_collection", + "arguments" : { + "filter" : { + "_id" : { + "$oid" : "000000000000000000000004" } } }, - "expectResult": { - "deletedCount": 1 + "expectResult" : { + "deletedCount" : 1 } }, { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000004" + "name" : "delete", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000004" } }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ], - "outcome": [ + "outcome" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000001" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000002" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0-with-empty-chunk", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000003" + }, + "length" : 2, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-2", + "metadata" : {} } ] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "files_id": { - "$oid": "000000000000000000000002" + "files_id" : { + "$oid" : "000000000000000000000002" }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "files_id": { - "$oid": "000000000000000000000003" + "files_id" : { + "$oid" : "000000000000000000000003" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESI=", + "subType" : "00" } } } diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/download.json b/driver-core/src/test/resources/unified-test-format/gridfs/download.json index 48d32462181..012b8b2d15b 100644 --- a/driver-core/src/test/resources/unified-test-format/gridfs/download.json +++ b/driver-core/src/test/resources/unified-test-format/gridfs/download.json @@ -1,452 +1,434 @@ { - "description": "gridfs-download", - "schemaVersion": "1.0", - "createEntities": [ + "description" : "gridfs-download", + "schemaVersion" : "1.0", + "createEntities" : [ { - "client": { - "id": "client0" + "client" : { + "id" : "client0" } }, { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" + "database" : { + "id" : "database0", + "client" : "client0", + "databaseName" : "gridfs-tests" } }, { - "bucket": { - "id": "bucket0", - "database": "database0" + "bucket" : { + "id" : "bucket0", + "database" : "database0" } }, { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" + "collection" : { + "id" : "bucket0_files_collection", + "database" : "database0", + "collectionName" : "fs.files" } }, { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" + "collection" : { + "id" : "bucket0_chunks_collection", + "database" : "database0", + "collectionName" : "fs.chunks" } } ], - "initialData": [ + "initialData" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000001" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", - "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000002" + }, + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-0-with-empty-chunk", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000003" + }, + "length" : 2, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-2", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "dd254cdc958e53abaa67da9f797125f5", - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000004" + }, + "length" : 8, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-8", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 10, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "57d83cd477bfb1ccd975ab33d827a92b", - "filename": "length-10", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000005" + }, + "length" : 10, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "filename" : "length-10", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000006" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "_id" : { + "$oid" : "000000000000000000000006" + }, + "length" : 2, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" + }, + "metadata" : {} } ] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "files_id": { - "$oid": "000000000000000000000002" + "files_id" : { + "$oid" : "000000000000000000000002" }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "files_id": { - "$oid": "000000000000000000000003" + "files_id" : { + "$oid" : "000000000000000000000003" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESI=", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000003" + "_id" : { + "$oid" : "000000000000000000000003" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000004" + "_id" : { + "$oid" : "000000000000000000000004" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" + "n" : 1, + "data" : { + "$binary" : { + "base64" : "VWZ3iA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000005" + "_id" : { + "$oid" : "000000000000000000000005" }, - "files_id": { - "$oid": "000000000000000000000005" + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000006" + "_id" : { + "$oid" : "000000000000000000000006" }, - "files_id": { - "$oid": "000000000000000000000005" + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" + "n" : 1, + "data" : { + "$binary" : { + "base64" : "VWZ3iA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000007" + "_id" : { + "$oid" : "000000000000000000000007" }, - "files_id": { - "$oid": "000000000000000000000005" + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 2, - "data": { - "$binary": { - "base64": "mao=", - "subType": "00" + "n" : 2, + "data" : { + "$binary" : { + "base64" : "mao=", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000008" + "_id" : { + "$oid" : "000000000000000000000008" }, - "files_id": { - "$oid": "000000000000000000000006" + "files_id" : { + "$oid" : "000000000000000000000006" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESI=", + "subType" : "00" } } } ] } ], - "tests": [ + "tests" : [ { - "description": "download when length is zero", - "operations": [ + "description" : "download when length is zero", + "operations" : [ { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000001" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000001" } }, - "expectResult": { - "$$matchesHexBytes": "" + "expectResult" : { + "$$matchesHexBytes" : "" } } ] }, { - "description": "download when length is zero and there is one empty chunk", - "operations": [ + "description" : "download when length is zero and there is one empty chunk", + "operations" : [ { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000002" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000002" } }, - "expectResult": { - "$$matchesHexBytes": "" + "expectResult" : { + "$$matchesHexBytes" : "" } } ] }, { - "description": "download when there is one chunk", - "operations": [ + "description" : "download when there is one chunk", + "operations" : [ { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000003" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000003" } }, - "expectResult": { - "$$matchesHexBytes": "1122" + "expectResult" : { + "$$matchesHexBytes" : "1122" } } ] }, { - "description": "download when there are two chunks", - "operations": [ + "description" : "download when there are two chunks", + "operations" : [ { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000004" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000004" } }, - "expectResult": { - "$$matchesHexBytes": "1122334455667788" + "expectResult" : { + "$$matchesHexBytes" : "1122334455667788" } } ] }, { - "description": "download when there are three chunks", - "operations": [ + "description" : "download when there are three chunks", + "operations" : [ { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000005" } }, - "expectResult": { - "$$matchesHexBytes": "112233445566778899aa" + "expectResult" : { + "$$matchesHexBytes" : "112233445566778899aa" } } ] }, { - "description": "download when files entry does not exist", - "operations": [ + "description" : "download when files entry does not exist", + "operations" : [ { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000000" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000000" } }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ] }, { - "description": "download when an intermediate chunk is missing", - "operations": [ + "description" : "download when an intermediate chunk is missing", + "operations" : [ { - "name": "deleteOne", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" + "name" : "deleteOne", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : { + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 1 + "n" : 1 } }, - "expectResult": { - "deletedCount": 1 + "expectResult" : { + "deletedCount" : 1 } }, { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000005" } }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ] }, { - "description": "download when final chunk is missing", - "operations": [ + "description" : "download when final chunk is missing", + "operations" : [ { - "name": "deleteOne", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" + "name" : "deleteOne", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : { + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 2 + "n" : 2 } }, - "expectResult": { - "deletedCount": 1 + "expectResult" : { + "deletedCount" : 1 } }, { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000005" } }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ] }, { - "description": "download when an intermediate chunk is the wrong size", - "operations": [ + "description" : "download when an intermediate chunk is the wrong size", + "operations" : [ { - "name": "bulkWrite", - "object": "bucket0_chunks_collection", - "arguments": { - "requests": [ + "name" : "bulkWrite", + "object" : "bucket0_chunks_collection", + "arguments" : { + "requests" : [ { - "updateOne": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" + "updateOne" : { + "filter" : { + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 1 + "n" : 1 }, - "update": { - "$set": { - "data": { - "$binary": { - "base64": "VWZ3", - "subType": "00" + "update" : { + "$set" : { + "data" : { + "$binary" : { + "base64" : "VWZ3", + "subType" : "00" } } } @@ -454,19 +436,19 @@ } }, { - "updateOne": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" + "updateOne" : { + "filter" : { + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 2 + "n" : 2 }, - "update": { - "$set": { - "data": { - "$binary": { - "base64": "iJmq", - "subType": "00" + "update" : { + "$set" : { + "data" : { + "$binary" : { + "base64" : "iJmq", + "subType" : "00" } } } @@ -475,81 +457,81 @@ } ] }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2 + "expectResult" : { + "matchedCount" : 2, + "modifiedCount" : 2 } }, { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000005" } }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ] }, { - "description": "download when final chunk is the wrong size", - "operations": [ + "description" : "download when final chunk is the wrong size", + "operations" : [ { - "name": "updateOne", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" + "name" : "updateOne", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : { + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 2 + "n" : 2 }, - "update": { - "$set": { - "data": { - "$binary": { - "base64": "mQ==", - "subType": "00" + "update" : { + "$set" : { + "data" : { + "$binary" : { + "base64" : "mQ==", + "subType" : "00" } } } } }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1 + "expectResult" : { + "matchedCount" : 1, + "modifiedCount" : 1 } }, { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000005" } }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ] }, { - "description": "download legacy file with no name", - "operations": [ + "description" : "download legacy file with no name", + "operations" : [ { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000006" + "name" : "download", + "object" : "bucket0", + "arguments" : { + "id" : { + "$oid" : "000000000000000000000006" } }, - "expectResult": { - "$$matchesHexBytes": "1122" + "expectResult" : { + "$$matchesHexBytes" : "1122" } } ] diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json b/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json index cd446639572..22c211c79ad 100644 --- a/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json +++ b/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json @@ -1,327 +1,312 @@ { - "description": "gridfs-downloadByName", - "schemaVersion": "1.0", - "createEntities": [ + "description" : "gridfs-downloadByName", + "schemaVersion" : "1.0", + "createEntities" : [ { - "client": { - "id": "client0" + "client" : { + "id" : "client0" } }, { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" + "database" : { + "id" : "database0", + "client" : "client0", + "databaseName" : "gridfs-tests" } }, { - "bucket": { - "id": "bucket0", - "database": "database0" + "bucket" : { + "id" : "bucket0", + "database" : "database0" } }, { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" + "collection" : { + "id" : "bucket0_files_collection", + "database" : "database0", + "collectionName" : "fs.files" } }, { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" + "collection" : { + "id" : "bucket0_chunks_collection", + "database" : "database0", + "collectionName" : "fs.chunks" } } ], - "initialData": [ + "initialData" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" + "length" : 1, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-01T00:00:00.000Z" }, - "md5": "47ed733b8d10be225eceba344d533586", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "abc", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-02T00:00:00.000Z" + "length" : 1, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-02T00:00:00.000Z" }, - "md5": "b15835f133ff2e27c7cb28117bfae8f4", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "abc", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000003" + "_id" : { + "$oid" : "000000000000000000000003" }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-03T00:00:00.000Z" + "length" : 1, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-03T00:00:00.000Z" }, - "md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "abc", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000004" + "_id" : { + "$oid" : "000000000000000000000004" }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-04T00:00:00.000Z" + "length" : 1, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-04T00:00:00.000Z" }, - "md5": "f623e75af30e62bbd73d6df5b50bb7b5", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "abc", + "metadata" : {} }, { - "_id": { - "$oid": "000000000000000000000005" + "_id" : { + "$oid" : "000000000000000000000005" }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-05T00:00:00.000Z" + "length" : 1, + "chunkSize" : 4, + "uploadDate" : { + "$date" : "1970-01-05T00:00:00.000Z" }, - "md5": "4c614360da93c0a041b22e537de151eb", - "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} + "filename" : "abc", + "metadata" : {} } ] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [ { - "_id": { - "$oid": "000000000000000000000001" + "_id" : { + "$oid" : "000000000000000000000001" }, - "files_id": { - "$oid": "000000000000000000000001" + "files_id" : { + "$oid" : "000000000000000000000001" }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "EQ==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000002" + "_id" : { + "$oid" : "000000000000000000000002" }, - "files_id": { - "$oid": "000000000000000000000002" + "files_id" : { + "$oid" : "000000000000000000000002" }, - "n": 0, - "data": { - "$binary": { - "base64": "Ig==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "Ig==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000003" + "_id" : { + "$oid" : "000000000000000000000003" }, - "files_id": { - "$oid": "000000000000000000000003" + "files_id" : { + "$oid" : "000000000000000000000003" }, - "n": 0, - "data": { - "$binary": { - "base64": "Mw==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "Mw==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000004" + "_id" : { + "$oid" : "000000000000000000000004" }, - "files_id": { - "$oid": "000000000000000000000004" + "files_id" : { + "$oid" : "000000000000000000000004" }, - "n": 0, - "data": { - "$binary": { - "base64": "RA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "RA==", + "subType" : "00" } } }, { - "_id": { - "$oid": "000000000000000000000005" + "_id" : { + "$oid" : "000000000000000000000005" }, - "files_id": { - "$oid": "000000000000000000000005" + "files_id" : { + "$oid" : "000000000000000000000005" }, - "n": 0, - "data": { - "$binary": { - "base64": "VQ==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "VQ==", + "subType" : "00" } } } ] } ], - "tests": [ + "tests" : [ { - "description": "downloadByName defaults to latest revision (-1)", - "operations": [ + "description" : "downloadByName defaults to latest revision (-1)", + "operations" : [ { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc" + "name" : "downloadByName", + "object" : "bucket0", + "arguments" : { + "filename" : "abc" }, - "expectResult": { - "$$matchesHexBytes": "55" + "expectResult" : { + "$$matchesHexBytes" : "55" } } ] }, { - "description": "downloadByName when revision is 0", - "operations": [ + "description" : "downloadByName when revision is 0", + "operations" : [ { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": 0 + "name" : "downloadByName", + "object" : "bucket0", + "arguments" : { + "filename" : "abc", + "revision" : 0 }, - "expectResult": { - "$$matchesHexBytes": "11" + "expectResult" : { + "$$matchesHexBytes" : "11" } } ] }, { - "description": "downloadByName when revision is 1", - "operations": [ + "description" : "downloadByName when revision is 1", + "operations" : [ { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": 1 + "name" : "downloadByName", + "object" : "bucket0", + "arguments" : { + "filename" : "abc", + "revision" : 1 }, - "expectResult": { - "$$matchesHexBytes": "22" + "expectResult" : { + "$$matchesHexBytes" : "22" } } ] }, { - "description": "downloadByName when revision is 2", - "operations": [ + "description" : "downloadByName when revision is 2", + "operations" : [ { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": 2 + "name" : "downloadByName", + "object" : "bucket0", + "arguments" : { + "filename" : "abc", + "revision" : 2 }, - "expectResult": { - "$$matchesHexBytes": "33" + "expectResult" : { + "$$matchesHexBytes" : "33" } } ] }, { - "description": "downloadByName when revision is -2", - "operations": [ + "description" : "downloadByName when revision is -2", + "operations" : [ { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": -2 + "name" : "downloadByName", + "object" : "bucket0", + "arguments" : { + "filename" : "abc", + "revision" : -2 }, - "expectResult": { - "$$matchesHexBytes": "44" + "expectResult" : { + "$$matchesHexBytes" : "44" } } ] }, { - "description": "downloadByName when revision is -1", - "operations": [ + "description" : "downloadByName when revision is -1", + "operations" : [ { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": -1 + "name" : "downloadByName", + "object" : "bucket0", + "arguments" : { + "filename" : "abc", + "revision" : -1 }, - "expectResult": { - "$$matchesHexBytes": "55" + "expectResult" : { + "$$matchesHexBytes" : "55" } } ] }, { - "description": "downloadByName when files entry does not exist", - "operations": [ + "description" : "downloadByName when files entry does not exist", + "operations" : [ { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "xyz" + "name" : "downloadByName", + "object" : "bucket0", + "arguments" : { + "filename" : "xyz" }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ] }, { - "description": "downloadByName when revision does not exist", - "operations": [ + "description" : "downloadByName when revision does not exist", + "operations" : [ { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": 999 + "name" : "downloadByName", + "object" : "bucket0", + "arguments" : { + "filename" : "abc", + "revision" : 999 }, - "expectError": { - "isError": true + "expectError" : { + "isError" : true } } ] diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/upload.json b/driver-core/src/test/resources/unified-test-format/gridfs/upload.json index 97e18d2bc25..8f91e9332d4 100644 --- a/driver-core/src/test/resources/unified-test-format/gridfs/upload.json +++ b/driver-core/src/test/resources/unified-test-format/gridfs/upload.json @@ -1,164 +1,164 @@ { - "description": "gridfs-upload", - "schemaVersion": "1.0", - "createEntities": [ + "description" : "gridfs-upload", + "schemaVersion" : "1.0", + "createEntities" : [ { - "client": { - "id": "client0" + "client" : { + "id" : "client0" } }, { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" + "database" : { + "id" : "database0", + "client" : "client0", + "databaseName" : "gridfs-tests" } }, { - "bucket": { - "id": "bucket0", - "database": "database0" + "bucket" : { + "id" : "bucket0", + "database" : "database0" } }, { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" + "collection" : { + "id" : "bucket0_files_collection", + "database" : "database0", + "collectionName" : "fs.files" } }, { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" + "collection" : { + "id" : "bucket0_chunks_collection", + "database" : "database0", + "collectionName" : "fs.chunks" } } ], - "initialData": [ + "initialData" : [ { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [] + "collectionName" : "fs.files", + "databaseName" : "gridfs-tests", + "documents" : [] }, { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [] + "collectionName" : "fs.chunks", + "databaseName" : "gridfs-tests", + "documents" : [] } ], - "tests": [ + "tests" : [ { - "description": "upload when length is 0", - "operations": [ + "description" : "upload when length is 0", + "operations" : [ { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "" + "name" : "upload", + "object" : "bucket0", + "arguments" : { + "filename" : "filename", + "source" : { + "$$hexBytes" : "" }, - "chunkSizeBytes": 4 + "chunkSizeBytes" : 4 }, - "expectResult": { - "$$type": "objectId" + "expectResult" : { + "$$type" : "objectId" }, - "saveResultAsEntity": "uploadedObjectId" + "saveResultAsEntity" : "uploadedObjectId" }, { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_files_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$matchesEntity": "uploadedObjectId" + "_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" + "length" : 0, + "chunkSize" : 4, + "uploadDate" : { + "$$type" : "date" }, - "md5": { - "$$unsetOrMatches": "d41d8cd98f00b204e9800998ecf8427e" + "md5" : { + "$$unsetOrMatches" : "d41d8cd98f00b204e9800998ecf8427e" }, - "filename": "filename" + "filename" : "filename" } ] }, { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [] + "expectResult" : [] } ] }, { - "description": "upload when length is 1", - "operations": [ + "description" : "upload when length is 1", + "operations" : [ { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "11" + "name" : "upload", + "object" : "bucket0", + "arguments" : { + "filename" : "filename", + "source" : { + "$$hexBytes" : "11" }, - "chunkSizeBytes": 4 + "chunkSizeBytes" : 4 }, - "expectResult": { - "$$type": "objectId" + "expectResult" : { + "$$type" : "objectId" }, - "saveResultAsEntity": "uploadedObjectId" + "saveResultAsEntity" : "uploadedObjectId" }, { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_files_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$matchesEntity": "uploadedObjectId" + "_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" + "length" : 1, + "chunkSize" : 4, + "uploadDate" : { + "$$type" : "date" }, - "md5": { - "$$unsetOrMatches": "47ed733b8d10be225eceba344d533586" + "md5" : { + "$$unsetOrMatches" : "47ed733b8d10be225eceba344d533586" }, - "filename": "filename" + "filename" : "filename" } ] }, { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$type": "objectId" + "_id" : { + "$$type" : "objectId" }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" + "files_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "EQ==", + "subType" : "00" } } } @@ -167,65 +167,65 @@ ] }, { - "description": "upload when length is 3", - "operations": [ + "description" : "upload when length is 3", + "operations" : [ { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "112233" + "name" : "upload", + "object" : "bucket0", + "arguments" : { + "filename" : "filename", + "source" : { + "$$hexBytes" : "112233" }, - "chunkSizeBytes": 4 + "chunkSizeBytes" : 4 }, - "expectResult": { - "$$type": "objectId" + "expectResult" : { + "$$type" : "objectId" }, - "saveResultAsEntity": "uploadedObjectId" + "saveResultAsEntity" : "uploadedObjectId" }, { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_files_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$matchesEntity": "uploadedObjectId" + "_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "length": 3, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" + "length" : 3, + "chunkSize" : 4, + "uploadDate" : { + "$$type" : "date" }, - "md5": { - "$$unsetOrMatches": "bafae3a174ab91fc70db7a6aa50f4f52" + "md5" : { + "$$unsetOrMatches" : "bafae3a174ab91fc70db7a6aa50f4f52" }, - "filename": "filename" + "filename" : "filename" } ] }, { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$type": "objectId" + "_id" : { + "$$type" : "objectId" }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" + "files_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIz", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIz", + "subType" : "00" } } } @@ -234,65 +234,65 @@ ] }, { - "description": "upload when length is 4", - "operations": [ + "description" : "upload when length is 4", + "operations" : [ { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "11223344" + "name" : "upload", + "object" : "bucket0", + "arguments" : { + "filename" : "filename", + "source" : { + "$$hexBytes" : "11223344" }, - "chunkSizeBytes": 4 + "chunkSizeBytes" : 4 }, - "expectResult": { - "$$type": "objectId" + "expectResult" : { + "$$type" : "objectId" }, - "saveResultAsEntity": "uploadedObjectId" + "saveResultAsEntity" : "uploadedObjectId" }, { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_files_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$matchesEntity": "uploadedObjectId" + "_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "length": 4, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" + "length" : 4, + "chunkSize" : 4, + "uploadDate" : { + "$$type" : "date" }, - "md5": { - "$$unsetOrMatches": "7e7c77cff5705d1f7574a25ef6662117" + "md5" : { + "$$unsetOrMatches" : "7e7c77cff5705d1f7574a25ef6662117" }, - "filename": "filename" + "filename" : "filename" } ] }, { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$type": "objectId" + "_id" : { + "$$type" : "objectId" }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" + "files_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } } @@ -301,83 +301,83 @@ ] }, { - "description": "upload when length is 5", - "operations": [ + "description" : "upload when length is 5", + "operations" : [ { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" + "name" : "upload", + "object" : "bucket0", + "arguments" : { + "filename" : "filename", + "source" : { + "$$hexBytes" : "1122334455" }, - "chunkSizeBytes": 4 + "chunkSizeBytes" : 4 }, - "expectResult": { - "$$type": "objectId" + "expectResult" : { + "$$type" : "objectId" }, - "saveResultAsEntity": "uploadedObjectId" + "saveResultAsEntity" : "uploadedObjectId" }, { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_files_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$matchesEntity": "uploadedObjectId" + "_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "length": 5, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" + "length" : 5, + "chunkSize" : 4, + "uploadDate" : { + "$$type" : "date" }, - "md5": { - "$$unsetOrMatches": "283d4fea5dded59cf837d3047328f5af" + "md5" : { + "$$unsetOrMatches" : "283d4fea5dded59cf837d3047328f5af" }, - "filename": "filename" + "filename" : "filename" } ] }, { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {}, - "sort": { - "n": 1 + "name" : "find", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : {}, + "sort" : { + "n" : 1 } }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$type": "objectId" + "_id" : { + "$$type" : "objectId" }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" + "files_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } }, { - "_id": { - "$$type": "objectId" + "_id" : { + "$$type" : "objectId" }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" + "files_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "n": 1, - "data": { - "$binary": { - "base64": "VQ==", - "subType": "00" + "n" : 1, + "data" : { + "$binary" : { + "base64" : "VQ==", + "subType" : "00" } } } @@ -386,83 +386,83 @@ ] }, { - "description": "upload when length is 8", - "operations": [ + "description" : "upload when length is 8", + "operations" : [ { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455667788" + "name" : "upload", + "object" : "bucket0", + "arguments" : { + "filename" : "filename", + "source" : { + "$$hexBytes" : "1122334455667788" }, - "chunkSizeBytes": 4 + "chunkSizeBytes" : 4 }, - "expectResult": { - "$$type": "objectId" + "expectResult" : { + "$$type" : "objectId" }, - "saveResultAsEntity": "uploadedObjectId" + "saveResultAsEntity" : "uploadedObjectId" }, { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_files_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$matchesEntity": "uploadedObjectId" + "_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" + "length" : 8, + "chunkSize" : 4, + "uploadDate" : { + "$$type" : "date" }, - "md5": { - "$$unsetOrMatches": "dd254cdc958e53abaa67da9f797125f5" + "md5" : { + "$$unsetOrMatches" : "dd254cdc958e53abaa67da9f797125f5" }, - "filename": "filename" + "filename" : "filename" } ] }, { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {}, - "sort": { - "n": 1 + "name" : "find", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : {}, + "sort" : { + "n" : 1 } }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$type": "objectId" + "_id" : { + "$$type" : "objectId" }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" + "files_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "ESIzRA==", + "subType" : "00" } } }, { - "_id": { - "$$type": "objectId" + "_id" : { + "$$type" : "objectId" }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" + "files_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" + "n" : 1, + "data" : { + "$binary" : { + "base64" : "VWZ3iA==", + "subType" : "00" } } } @@ -471,140 +471,71 @@ ] }, { - "description": "upload when contentType is provided", - "operations": [ + "description" : "upload when metadata is provided", + "operations" : [ { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "11" + "name" : "upload", + "object" : "bucket0", + "arguments" : { + "filename" : "filename", + "source" : { + "$$hexBytes" : "11" }, - "chunkSizeBytes": 4, - "contentType": "image/jpeg" - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "47ed733b8d10be225eceba344d533586" - }, - "filename": "filename", - "contentType": "image/jpeg" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "upload when metadata is provided", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "11" - }, - "chunkSizeBytes": 4, - "metadata": { - "x": 1 + "chunkSizeBytes" : 4, + "metadata" : { + "x" : 1 } }, - "expectResult": { - "$$type": "objectId" + "expectResult" : { + "$$type" : "objectId" }, - "saveResultAsEntity": "uploadedObjectId" + "saveResultAsEntity" : "uploadedObjectId" }, { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_files_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$matchesEntity": "uploadedObjectId" + "_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" + "length" : 1, + "chunkSize" : 4, + "uploadDate" : { + "$$type" : "date" }, - "md5": { - "$$unsetOrMatches": "47ed733b8d10be225eceba344d533586" + "md5" : { + "$$unsetOrMatches" : "47ed733b8d10be225eceba344d533586" }, - "filename": "filename", - "metadata": { - "x": 1 + "filename" : "filename", + "metadata" : { + "x" : 1 } } ] }, { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} + "name" : "find", + "object" : "bucket0_chunks_collection", + "arguments" : { + "filter" : {} }, - "expectResult": [ + "expectResult" : [ { - "_id": { - "$$type": "objectId" + "_id" : { + "$$type" : "objectId" }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" + "files_id" : { + "$$matchesEntity" : "uploadedObjectId" }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" + "n" : 0, + "data" : { + "$binary" : { + "base64" : "EQ==", + "subType" : "00" } } } From 757a8d592f0821a746c602b8cd92d3949e93ff00 Mon Sep 17 00:00:00 2001 From: Joy Kim Date: Tue, 10 Dec 2024 11:49:26 -0500 Subject: [PATCH 2/3] Disable auto-formatting --- data/.mlaunch_startup | 71 ++ .../unified-test-format/gridfs/delete.json | 882 +++++++++--------- .../unified-test-format/gridfs/download.json | 618 ++++++------ .../gridfs/downloadByName.json | 366 ++++---- .../unified-test-format/gridfs/upload.json | 650 ++++++------- 5 files changed, 1329 insertions(+), 1258 deletions(-) create mode 100644 data/.mlaunch_startup diff --git a/data/.mlaunch_startup b/data/.mlaunch_startup new file mode 100644 index 00000000000..c061b70e7b8 --- /dev/null +++ b/data/.mlaunch_startup @@ -0,0 +1,71 @@ +{ +"protocol_version": 2, +"mtools_version": "1.7.2", +"parsed_args": { +"no_progressbar": false, +"command": "init", +"single": true, +"replicaset": false, +"nodes": 3, +"arbiter": false, +"name": "replset", +"priority": false, +"sharded": null, +"config": 1, +"csrs": true, +"mongos": 1, +"verbose": false, +"port": 27017, +"binarypath": null, +"dir": "/Users/joykim/mongo-java-driver/data", +"hostname": "localhost", +"auth": false, +"username": "user", +"password": "password", +"auth_db": "admin", +"auth_roles": [ +"dbAdminAnyDatabase", +"readWriteAnyDatabase", +"userAdminAnyDatabase", +"clusterAdmin" +], +"auth_role_docs": false, +"initial-user": true, +"tlsCAFile": null, +"tlsCRLFile": null, +"tlsAllowInvalidHostnames": false, +"tlsAllowInvalidCertificates": false, +"tlsMode": null, +"tlsCertificateKeyFile": null, +"tlsCertificateKeyFilePassword": null, +"tlsClusterFile": null, +"tlsClusterPassword": null, +"tlsDisabledProtocols": null, +"tlsAllowConnectionsWithoutCertificates": false, +"tlsFIPSMode": false, +"tlsClientCertificateKeyFile": null, +"tlsClientCertificateKeyFilePassword": null, +"sslCAFile": null, +"sslCRLFile": null, +"sslAllowInvalidHostnames": false, +"sslAllowInvalidCertificates": false, +"sslMode": null, +"sslPEMKeyFile": null, +"sslPEMKeyPassword": null, +"sslClusterFile": null, +"sslClusterPassword": null, +"sslDisabledProtocols": null, +"sslAllowConnectionsWithoutCertificates": false, +"sslFIPSMode": false, +"sslClientCertificate": null, +"sslClientPEMKeyFile": null, +"sslClientPEMKeyPassword": null +}, +"unknown_args": [ +"--setParameter", +"enableTestCommands=1" +], +"startup_info": { +"27017": "\"mongod\" --dbpath \"/Users/joykim/mongo-java-driver/data/db\" --logpath \"/Users/joykim/mongo-java-driver/data/mongod.log\" --port 27017 --fork --setParameter \"enableTestCommands=1\" --wiredTigerCacheSizeGB 1 " +} +} \ No newline at end of file diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/delete.json b/driver-core/src/test/resources/unified-test-format/gridfs/delete.json index 14bc4f8cc7f..277b9ed7e17 100644 --- a/driver-core/src/test/resources/unified-test-format/gridfs/delete.json +++ b/driver-core/src/test/resources/unified-test-format/gridfs/delete.json @@ -1,280 +1,280 @@ { - "description" : "gridfs-delete", - "schemaVersion" : "1.0", - "createEntities" : [ + "description": "gridfs-delete", + "schemaVersion": "1.0", + "createEntities": [ { - "client" : { - "id" : "client0" + "client": { + "id": "client0" } }, { - "database" : { - "id" : "database0", - "client" : "client0", - "databaseName" : "gridfs-tests" + "database": { + "id": "database0", + "client": "client0", + "databaseName": "gridfs-tests" } }, { - "bucket" : { - "id" : "bucket0", - "database" : "database0" + "bucket": { + "id": "bucket0", + "database": "database0" } }, { - "collection" : { - "id" : "bucket0_files_collection", - "database" : "database0", - "collectionName" : "fs.files" + "collection": { + "id": "bucket0_files_collection", + "database": "database0", + "collectionName": "fs.files" } }, { - "collection" : { - "id" : "bucket0_chunks_collection", - "database" : "database0", - "collectionName" : "fs.chunks" + "collection": { + "id": "bucket0_chunks_collection", + "database": "database0", + "collectionName": "fs.chunks" } } ], - "initialData" : [ + "initialData": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0", - "metadata" : {} + "filename": "length-0", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0-with-empty-chunk", - "metadata" : {} + "filename": "length-0-with-empty-chunk", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "length" : 2, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 2, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-2", - "metadata" : {} + "filename": "length-2", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "length" : 8, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 8, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-8", - "metadata" : {} + "filename": "length-8", + "metadata": {} } ] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "files_id" : { - "$oid" : "000000000000000000000002" + "files_id": { + "$oid": "000000000000000000000002" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "files_id" : { - "$oid" : "000000000000000000000003" + "files_id": { + "$oid": "000000000000000000000003" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESI=", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESI=", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 1, - "data" : { - "$binary" : { - "base64" : "VWZ3iA==", - "subType" : "00" + "n": 1, + "data": { + "$binary": { + "base64": "VWZ3iA==", + "subType": "00" } } } ] } ], - "tests" : [ + "tests": [ { - "description" : "delete when length is 0", - "operations" : [ + "description": "delete when length is 0", + "operations": [ { - "name" : "delete", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000001" + "name": "delete", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000001" } } } ], - "outcome" : [ + "outcome": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0-with-empty-chunk", - "metadata" : {} + "filename": "length-0-with-empty-chunk", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "length" : 2, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 2, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-2", - "metadata" : {} + "filename": "length-2", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "length" : 8, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 8, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-8", - "metadata" : {} + "filename": "length-8", + "metadata": {} } ] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "files_id" : { - "$oid" : "000000000000000000000002" + "files_id": { + "$oid": "000000000000000000000002" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "files_id" : { - "$oid" : "000000000000000000000003" + "files_id": { + "$oid": "000000000000000000000003" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESI=", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESI=", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 1, - "data" : { - "$binary" : { - "base64" : "VWZ3iA==", - "subType" : "00" + "n": 1, + "data": { + "$binary": { + "base64": "VWZ3iA==", + "subType": "00" } } } @@ -283,107 +283,107 @@ ] }, { - "description" : "delete when length is 0 and there is one extra empty chunk", - "operations" : [ + "description": "delete when length is 0 and there is one extra empty chunk", + "operations": [ { - "name" : "delete", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000002" + "name": "delete", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000002" } } } ], - "outcome" : [ + "outcome": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0", - "metadata" : {} + "filename": "length-0", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "length" : 2, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 2, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-2", - "metadata" : {} + "filename": "length-2", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "length" : 8, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 8, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-8", - "metadata" : {} + "filename": "length-8", + "metadata": {} } ] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "files_id" : { - "$oid" : "000000000000000000000003" + "files_id": { + "$oid": "000000000000000000000003" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESI=", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESI=", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 1, - "data" : { - "$binary" : { - "base64" : "VWZ3iA==", - "subType" : "00" + "n": 1, + "data": { + "$binary": { + "base64": "VWZ3iA==", + "subType": "00" } } } @@ -392,92 +392,92 @@ ] }, { - "description" : "delete when length is 8", - "operations" : [ + "description": "delete when length is 8", + "operations": [ { - "name" : "delete", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000004" + "name": "delete", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000004" } } } ], - "outcome" : [ + "outcome": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0", - "metadata" : {} + "filename": "length-0", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0-with-empty-chunk", - "metadata" : {} + "filename": "length-0-with-empty-chunk", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "length" : 2, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 2, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-2", - "metadata" : {} + "filename": "length-2", + "metadata": {} } ] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "files_id" : { - "$oid" : "000000000000000000000002" + "files_id": { + "$oid": "000000000000000000000002" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "files_id" : { - "$oid" : "000000000000000000000003" + "files_id": { + "$oid": "000000000000000000000003" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESI=", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESI=", + "subType": "00" } } } @@ -486,137 +486,137 @@ ] }, { - "description" : "delete when files entry does not exist", - "operations" : [ + "description": "delete when files entry does not exist", + "operations": [ { - "name" : "delete", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000000" + "name": "delete", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000000" } }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ], - "outcome" : [ + "outcome": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0", - "metadata" : {} + "filename": "length-0", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0-with-empty-chunk", - "metadata" : {} + "filename": "length-0-with-empty-chunk", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "length" : 2, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 2, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-2", - "metadata" : {} + "filename": "length-2", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "length" : 8, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 8, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-8", - "metadata" : {} + "filename": "length-8", + "metadata": {} } ] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "files_id" : { - "$oid" : "000000000000000000000002" + "files_id": { + "$oid": "000000000000000000000002" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "files_id" : { - "$oid" : "000000000000000000000003" + "files_id": { + "$oid": "000000000000000000000003" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESI=", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESI=", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 1, - "data" : { - "$binary" : { - "base64" : "VWZ3iA==", - "subType" : "00" + "n": 1, + "data": { + "$binary": { + "base64": "VWZ3iA==", + "subType": "00" } } } @@ -625,109 +625,109 @@ ] }, { - "description" : "delete when files entry does not exist and there are orphaned chunks", - "operations" : [ + "description": "delete when files entry does not exist and there are orphaned chunks", + "operations": [ { - "name" : "deleteOne", - "object" : "bucket0_files_collection", - "arguments" : { - "filter" : { - "_id" : { - "$oid" : "000000000000000000000004" + "name": "deleteOne", + "object": "bucket0_files_collection", + "arguments": { + "filter": { + "_id": { + "$oid": "000000000000000000000004" } } }, - "expectResult" : { - "deletedCount" : 1 + "expectResult": { + "deletedCount": 1 } }, { - "name" : "delete", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000004" + "name": "delete", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000004" } }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ], - "outcome" : [ + "outcome": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0", - "metadata" : {} + "filename": "length-0", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0-with-empty-chunk", - "metadata" : {} + "filename": "length-0-with-empty-chunk", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "length" : 2, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 2, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-2", - "metadata" : {} + "filename": "length-2", + "metadata": {} } ] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "files_id" : { - "$oid" : "000000000000000000000002" + "files_id": { + "$oid": "000000000000000000000002" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "files_id" : { - "$oid" : "000000000000000000000003" + "files_id": { + "$oid": "000000000000000000000003" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESI=", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESI=", + "subType": "00" } } } diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/download.json b/driver-core/src/test/resources/unified-test-format/gridfs/download.json index 012b8b2d15b..f0cb8517088 100644 --- a/driver-core/src/test/resources/unified-test-format/gridfs/download.json +++ b/driver-core/src/test/resources/unified-test-format/gridfs/download.json @@ -1,434 +1,434 @@ { - "description" : "gridfs-download", - "schemaVersion" : "1.0", - "createEntities" : [ + "description": "gridfs-download", + "schemaVersion": "1.0", + "createEntities": [ { - "client" : { - "id" : "client0" + "client": { + "id": "client0" } }, { - "database" : { - "id" : "database0", - "client" : "client0", - "databaseName" : "gridfs-tests" + "database": { + "id": "database0", + "client": "client0", + "databaseName": "gridfs-tests" } }, { - "bucket" : { - "id" : "bucket0", - "database" : "database0" + "bucket": { + "id": "bucket0", + "database": "database0" } }, { - "collection" : { - "id" : "bucket0_files_collection", - "database" : "database0", - "collectionName" : "fs.files" + "collection": { + "id": "bucket0_files_collection", + "database": "database0", + "collectionName": "fs.files" } }, { - "collection" : { - "id" : "bucket0_chunks_collection", - "database" : "database0", - "collectionName" : "fs.chunks" + "collection": { + "id": "bucket0_chunks_collection", + "database": "database0", + "collectionName": "fs.chunks" } } ], - "initialData" : [ + "initialData": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0", - "metadata" : {} + "filename": "length-0", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-0-with-empty-chunk", - "metadata" : {} + "filename": "length-0-with-empty-chunk", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "length" : 2, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 2, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-2", - "metadata" : {} + "filename": "length-2", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "length" : 8, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 8, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-8", - "metadata" : {} + "filename": "length-8", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000005" + "_id": { + "$oid": "000000000000000000000005" }, - "length" : 10, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 10, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "length-10", - "metadata" : {} + "filename": "length-10", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000006" + "_id": { + "$oid": "000000000000000000000006" }, - "length" : 2, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 2, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "metadata" : {} + "metadata": {} } ] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "files_id" : { - "$oid" : "000000000000000000000002" + "files_id": { + "$oid": "000000000000000000000002" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "files_id" : { - "$oid" : "000000000000000000000003" + "files_id": { + "$oid": "000000000000000000000003" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESI=", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESI=", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 1, - "data" : { - "$binary" : { - "base64" : "VWZ3iA==", - "subType" : "00" + "n": 1, + "data": { + "$binary": { + "base64": "VWZ3iA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000005" + "_id": { + "$oid": "000000000000000000000005" }, - "files_id" : { - "$oid" : "000000000000000000000005" + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000006" + "_id": { + "$oid": "000000000000000000000006" }, - "files_id" : { - "$oid" : "000000000000000000000005" + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 1, - "data" : { - "$binary" : { - "base64" : "VWZ3iA==", - "subType" : "00" + "n": 1, + "data": { + "$binary": { + "base64": "VWZ3iA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000007" + "_id": { + "$oid": "000000000000000000000007" }, - "files_id" : { - "$oid" : "000000000000000000000005" + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 2, - "data" : { - "$binary" : { - "base64" : "mao=", - "subType" : "00" + "n": 2, + "data": { + "$binary": { + "base64": "mao=", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000008" + "_id": { + "$oid": "000000000000000000000008" }, - "files_id" : { - "$oid" : "000000000000000000000006" + "files_id": { + "$oid": "000000000000000000000006" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESI=", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESI=", + "subType": "00" } } } ] } ], - "tests" : [ + "tests": [ { - "description" : "download when length is zero", - "operations" : [ + "description": "download when length is zero", + "operations": [ { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000001" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000001" } }, - "expectResult" : { - "$$matchesHexBytes" : "" + "expectResult": { + "$$matchesHexBytes": "" } } ] }, { - "description" : "download when length is zero and there is one empty chunk", - "operations" : [ + "description": "download when length is zero and there is one empty chunk", + "operations": [ { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000002" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000002" } }, - "expectResult" : { - "$$matchesHexBytes" : "" + "expectResult": { + "$$matchesHexBytes": "" } } ] }, { - "description" : "download when there is one chunk", - "operations" : [ + "description": "download when there is one chunk", + "operations": [ { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000003" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000003" } }, - "expectResult" : { - "$$matchesHexBytes" : "1122" + "expectResult": { + "$$matchesHexBytes": "1122" } } ] }, { - "description" : "download when there are two chunks", - "operations" : [ + "description": "download when there are two chunks", + "operations": [ { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000004" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000004" } }, - "expectResult" : { - "$$matchesHexBytes" : "1122334455667788" + "expectResult": { + "$$matchesHexBytes": "1122334455667788" } } ] }, { - "description" : "download when there are three chunks", - "operations" : [ + "description": "download when there are three chunks", + "operations": [ { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000005" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000005" } }, - "expectResult" : { - "$$matchesHexBytes" : "112233445566778899aa" + "expectResult": { + "$$matchesHexBytes": "112233445566778899aa" } } ] }, { - "description" : "download when files entry does not exist", - "operations" : [ + "description": "download when files entry does not exist", + "operations": [ { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000000" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000000" } }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ] }, { - "description" : "download when an intermediate chunk is missing", - "operations" : [ + "description": "download when an intermediate chunk is missing", + "operations": [ { - "name" : "deleteOne", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : { - "files_id" : { - "$oid" : "000000000000000000000005" + "name": "deleteOne", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": { + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 1 + "n": 1 } }, - "expectResult" : { - "deletedCount" : 1 + "expectResult": { + "deletedCount": 1 } }, { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000005" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000005" } }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ] }, { - "description" : "download when final chunk is missing", - "operations" : [ + "description": "download when final chunk is missing", + "operations": [ { - "name" : "deleteOne", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : { - "files_id" : { - "$oid" : "000000000000000000000005" + "name": "deleteOne", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": { + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 2 + "n": 2 } }, - "expectResult" : { - "deletedCount" : 1 + "expectResult": { + "deletedCount": 1 } }, { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000005" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000005" } }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ] }, { - "description" : "download when an intermediate chunk is the wrong size", - "operations" : [ + "description": "download when an intermediate chunk is the wrong size", + "operations": [ { - "name" : "bulkWrite", - "object" : "bucket0_chunks_collection", - "arguments" : { - "requests" : [ + "name": "bulkWrite", + "object": "bucket0_chunks_collection", + "arguments": { + "requests": [ { - "updateOne" : { - "filter" : { - "files_id" : { - "$oid" : "000000000000000000000005" + "updateOne": { + "filter": { + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 1 + "n": 1 }, - "update" : { - "$set" : { - "data" : { - "$binary" : { - "base64" : "VWZ3", - "subType" : "00" + "update": { + "$set": { + "data": { + "$binary": { + "base64": "VWZ3", + "subType": "00" } } } @@ -436,19 +436,19 @@ } }, { - "updateOne" : { - "filter" : { - "files_id" : { - "$oid" : "000000000000000000000005" + "updateOne": { + "filter": { + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 2 + "n": 2 }, - "update" : { - "$set" : { - "data" : { - "$binary" : { - "base64" : "iJmq", - "subType" : "00" + "update": { + "$set": { + "data": { + "$binary": { + "base64": "iJmq", + "subType": "00" } } } @@ -457,81 +457,81 @@ } ] }, - "expectResult" : { - "matchedCount" : 2, - "modifiedCount" : 2 + "expectResult": { + "matchedCount": 2, + "modifiedCount": 2 } }, { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000005" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000005" } }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ] }, { - "description" : "download when final chunk is the wrong size", - "operations" : [ + "description": "download when final chunk is the wrong size", + "operations": [ { - "name" : "updateOne", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : { - "files_id" : { - "$oid" : "000000000000000000000005" + "name": "updateOne", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": { + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 2 + "n": 2 }, - "update" : { - "$set" : { - "data" : { - "$binary" : { - "base64" : "mQ==", - "subType" : "00" + "update": { + "$set": { + "data": { + "$binary": { + "base64": "mQ==", + "subType": "00" } } } } }, - "expectResult" : { - "matchedCount" : 1, - "modifiedCount" : 1 + "expectResult": { + "matchedCount": 1, + "modifiedCount": 1 } }, { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000005" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000005" } }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ] }, { - "description" : "download legacy file with no name", - "operations" : [ + "description": "download legacy file with no name", + "operations": [ { - "name" : "download", - "object" : "bucket0", - "arguments" : { - "id" : { - "$oid" : "000000000000000000000006" + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000006" } }, - "expectResult" : { - "$$matchesHexBytes" : "1122" + "expectResult": { + "$$matchesHexBytes": "1122" } } ] diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json b/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json index 22c211c79ad..7b20933c163 100644 --- a/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json +++ b/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json @@ -1,312 +1,312 @@ { - "description" : "gridfs-downloadByName", - "schemaVersion" : "1.0", - "createEntities" : [ + "description": "gridfs-downloadByName", + "schemaVersion": "1.0", + "createEntities": [ { - "client" : { - "id" : "client0" + "client": { + "id": "client0" } }, { - "database" : { - "id" : "database0", - "client" : "client0", - "databaseName" : "gridfs-tests" + "database": { + "id": "database0", + "client": "client0", + "databaseName": "gridfs-tests" } }, { - "bucket" : { - "id" : "bucket0", - "database" : "database0" + "bucket": { + "id": "bucket0", + "database": "database0" } }, { - "collection" : { - "id" : "bucket0_files_collection", - "database" : "database0", - "collectionName" : "fs.files" + "collection": { + "id": "bucket0_files_collection", + "database": "database0", + "collectionName": "fs.files" } }, { - "collection" : { - "id" : "bucket0_chunks_collection", - "database" : "database0", - "collectionName" : "fs.chunks" + "collection": { + "id": "bucket0_chunks_collection", + "database": "database0", + "collectionName": "fs.chunks" } } ], - "initialData" : [ + "initialData": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "length" : 1, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-01T00:00:00.000Z" + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" }, - "filename" : "abc", - "metadata" : {} + "filename": "abc", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "length" : 1, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-02T00:00:00.000Z" + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-02T00:00:00.000Z" }, - "filename" : "abc", - "metadata" : {} + "filename": "abc", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "length" : 1, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-03T00:00:00.000Z" + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-03T00:00:00.000Z" }, - "filename" : "abc", - "metadata" : {} + "filename": "abc", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "length" : 1, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-04T00:00:00.000Z" + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-04T00:00:00.000Z" }, - "filename" : "abc", - "metadata" : {} + "filename": "abc", + "metadata": {} }, { - "_id" : { - "$oid" : "000000000000000000000005" + "_id": { + "$oid": "000000000000000000000005" }, - "length" : 1, - "chunkSize" : 4, - "uploadDate" : { - "$date" : "1970-01-05T00:00:00.000Z" + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-05T00:00:00.000Z" }, - "filename" : "abc", - "metadata" : {} + "filename": "abc", + "metadata": {} } ] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [ + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ { - "_id" : { - "$oid" : "000000000000000000000001" + "_id": { + "$oid": "000000000000000000000001" }, - "files_id" : { - "$oid" : "000000000000000000000001" + "files_id": { + "$oid": "000000000000000000000001" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "EQ==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "EQ==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000002" + "_id": { + "$oid": "000000000000000000000002" }, - "files_id" : { - "$oid" : "000000000000000000000002" + "files_id": { + "$oid": "000000000000000000000002" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "Ig==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "Ig==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000003" + "_id": { + "$oid": "000000000000000000000003" }, - "files_id" : { - "$oid" : "000000000000000000000003" + "files_id": { + "$oid": "000000000000000000000003" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "Mw==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "Mw==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000004" + "_id": { + "$oid": "000000000000000000000004" }, - "files_id" : { - "$oid" : "000000000000000000000004" + "files_id": { + "$oid": "000000000000000000000004" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "RA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "RA==", + "subType": "00" } } }, { - "_id" : { - "$oid" : "000000000000000000000005" + "_id": { + "$oid": "000000000000000000000005" }, - "files_id" : { - "$oid" : "000000000000000000000005" + "files_id": { + "$oid": "000000000000000000000005" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "VQ==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "VQ==", + "subType": "00" } } } ] } ], - "tests" : [ + "tests": [ { - "description" : "downloadByName defaults to latest revision (-1)", - "operations" : [ + "description": "downloadByName defaults to latest revision (-1)", + "operations": [ { - "name" : "downloadByName", - "object" : "bucket0", - "arguments" : { - "filename" : "abc" + "name": "downloadByName", + "object": "bucket0", + "arguments": { + "filename": "abc" }, - "expectResult" : { - "$$matchesHexBytes" : "55" + "expectResult": { + "$$matchesHexBytes": "55" } } ] }, { - "description" : "downloadByName when revision is 0", - "operations" : [ + "description": "downloadByName when revision is 0", + "operations": [ { - "name" : "downloadByName", - "object" : "bucket0", - "arguments" : { - "filename" : "abc", - "revision" : 0 + "name": "downloadByName", + "object": "bucket0", + "arguments": { + "filename": "abc", + "revision": 0 }, - "expectResult" : { - "$$matchesHexBytes" : "11" + "expectResult": { + "$$matchesHexBytes": "11" } } ] }, { - "description" : "downloadByName when revision is 1", - "operations" : [ + "description": "downloadByName when revision is 1", + "operations": [ { - "name" : "downloadByName", - "object" : "bucket0", - "arguments" : { - "filename" : "abc", - "revision" : 1 + "name": "downloadByName", + "object": "bucket0", + "arguments": { + "filename": "abc", + "revision": 1 }, - "expectResult" : { - "$$matchesHexBytes" : "22" + "expectResult": { + "$$matchesHexBytes": "22" } } ] }, { - "description" : "downloadByName when revision is 2", - "operations" : [ + "description": "downloadByName when revision is 2", + "operations": [ { - "name" : "downloadByName", - "object" : "bucket0", - "arguments" : { - "filename" : "abc", - "revision" : 2 + "name": "downloadByName", + "object": "bucket0", + "arguments": { + "filename": "abc", + "revision": 2 }, - "expectResult" : { - "$$matchesHexBytes" : "33" + "expectResult": { + "$$matchesHexBytes": "33" } } ] }, { - "description" : "downloadByName when revision is -2", - "operations" : [ + "description": "downloadByName when revision is -2", + "operations": [ { - "name" : "downloadByName", - "object" : "bucket0", - "arguments" : { - "filename" : "abc", - "revision" : -2 + "name": "downloadByName", + "object": "bucket0", + "arguments": { + "filename": "abc", + "revision": -2 }, - "expectResult" : { - "$$matchesHexBytes" : "44" + "expectResult": { + "$$matchesHexBytes": "44" } } ] }, { - "description" : "downloadByName when revision is -1", - "operations" : [ + "description": "downloadByName when revision is -1", + "operations": [ { - "name" : "downloadByName", - "object" : "bucket0", - "arguments" : { - "filename" : "abc", - "revision" : -1 + "name": "downloadByName", + "object": "bucket0", + "arguments": { + "filename": "abc", + "revision": -1 }, - "expectResult" : { - "$$matchesHexBytes" : "55" + "expectResult": { + "$$matchesHexBytes": "55" } } ] }, { - "description" : "downloadByName when files entry does not exist", - "operations" : [ + "description": "downloadByName when files entry does not exist", + "operations": [ { - "name" : "downloadByName", - "object" : "bucket0", - "arguments" : { - "filename" : "xyz" + "name": "downloadByName", + "object": "bucket0", + "arguments": { + "filename": "xyz" }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ] }, { - "description" : "downloadByName when revision does not exist", - "operations" : [ + "description": "downloadByName when revision does not exist", + "operations": [ { - "name" : "downloadByName", - "object" : "bucket0", - "arguments" : { - "filename" : "abc", - "revision" : 999 + "name": "downloadByName", + "object": "bucket0", + "arguments": { + "filename": "abc", + "revision": 999 }, - "expectError" : { - "isError" : true + "expectError": { + "isError": true } } ] diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/upload.json b/driver-core/src/test/resources/unified-test-format/gridfs/upload.json index 8f91e9332d4..3c1644653a5 100644 --- a/driver-core/src/test/resources/unified-test-format/gridfs/upload.json +++ b/driver-core/src/test/resources/unified-test-format/gridfs/upload.json @@ -1,164 +1,164 @@ { - "description" : "gridfs-upload", - "schemaVersion" : "1.0", - "createEntities" : [ + "description": "gridfs-upload", + "schemaVersion": "1.0", + "createEntities": [ { - "client" : { - "id" : "client0" + "client": { + "id": "client0" } }, { - "database" : { - "id" : "database0", - "client" : "client0", - "databaseName" : "gridfs-tests" + "database": { + "id": "database0", + "client": "client0", + "databaseName": "gridfs-tests" } }, { - "bucket" : { - "id" : "bucket0", - "database" : "database0" + "bucket": { + "id": "bucket0", + "database": "database0" } }, { - "collection" : { - "id" : "bucket0_files_collection", - "database" : "database0", - "collectionName" : "fs.files" + "collection": { + "id": "bucket0_files_collection", + "database": "database0", + "collectionName": "fs.files" } }, { - "collection" : { - "id" : "bucket0_chunks_collection", - "database" : "database0", - "collectionName" : "fs.chunks" + "collection": { + "id": "bucket0_chunks_collection", + "database": "database0", + "collectionName": "fs.chunks" } } ], - "initialData" : [ + "initialData": [ { - "collectionName" : "fs.files", - "databaseName" : "gridfs-tests", - "documents" : [] + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [] }, { - "collectionName" : "fs.chunks", - "databaseName" : "gridfs-tests", - "documents" : [] + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [] } ], - "tests" : [ + "tests": [ { - "description" : "upload when length is 0", - "operations" : [ + "description": "upload when length is 0", + "operations": [ { - "name" : "upload", - "object" : "bucket0", - "arguments" : { - "filename" : "filename", - "source" : { - "$$hexBytes" : "" + "name": "upload", + "object": "bucket0", + "arguments": { + "filename": "filename", + "source": { + "$$hexBytes": "" }, - "chunkSizeBytes" : 4 + "chunkSizeBytes": 4 }, - "expectResult" : { - "$$type" : "objectId" + "expectResult": { + "$$type": "objectId" }, - "saveResultAsEntity" : "uploadedObjectId" + "saveResultAsEntity": "uploadedObjectId" }, { - "name" : "find", - "object" : "bucket0_files_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_files_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$matchesEntity" : "uploadedObjectId" + "_id": { + "$$matchesEntity": "uploadedObjectId" }, - "length" : 0, - "chunkSize" : 4, - "uploadDate" : { - "$$type" : "date" + "length": 0, + "chunkSize": 4, + "uploadDate": { + "$$type": "date" }, - "md5" : { - "$$unsetOrMatches" : "d41d8cd98f00b204e9800998ecf8427e" + "md5": { + "$$unsetOrMatches": "d41d8cd98f00b204e9800998ecf8427e" }, - "filename" : "filename" + "filename": "filename" } ] }, { - "name" : "find", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": {} }, - "expectResult" : [] + "expectResult": [] } ] }, { - "description" : "upload when length is 1", - "operations" : [ + "description": "upload when length is 1", + "operations": [ { - "name" : "upload", - "object" : "bucket0", - "arguments" : { - "filename" : "filename", - "source" : { - "$$hexBytes" : "11" + "name": "upload", + "object": "bucket0", + "arguments": { + "filename": "filename", + "source": { + "$$hexBytes": "11" }, - "chunkSizeBytes" : 4 + "chunkSizeBytes": 4 }, - "expectResult" : { - "$$type" : "objectId" + "expectResult": { + "$$type": "objectId" }, - "saveResultAsEntity" : "uploadedObjectId" + "saveResultAsEntity": "uploadedObjectId" }, { - "name" : "find", - "object" : "bucket0_files_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_files_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$matchesEntity" : "uploadedObjectId" + "_id": { + "$$matchesEntity": "uploadedObjectId" }, - "length" : 1, - "chunkSize" : 4, - "uploadDate" : { - "$$type" : "date" + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$$type": "date" }, - "md5" : { - "$$unsetOrMatches" : "47ed733b8d10be225eceba344d533586" + "md5": { + "$$unsetOrMatches": "47ed733b8d10be225eceba344d533586" }, - "filename" : "filename" + "filename": "filename" } ] }, { - "name" : "find", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$type" : "objectId" + "_id": { + "$$type": "objectId" }, - "files_id" : { - "$$matchesEntity" : "uploadedObjectId" + "files_id": { + "$$matchesEntity": "uploadedObjectId" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "EQ==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "EQ==", + "subType": "00" } } } @@ -167,65 +167,65 @@ ] }, { - "description" : "upload when length is 3", - "operations" : [ + "description": "upload when length is 3", + "operations": [ { - "name" : "upload", - "object" : "bucket0", - "arguments" : { - "filename" : "filename", - "source" : { - "$$hexBytes" : "112233" + "name": "upload", + "object": "bucket0", + "arguments": { + "filename": "filename", + "source": { + "$$hexBytes": "112233" }, - "chunkSizeBytes" : 4 + "chunkSizeBytes": 4 }, - "expectResult" : { - "$$type" : "objectId" + "expectResult": { + "$$type": "objectId" }, - "saveResultAsEntity" : "uploadedObjectId" + "saveResultAsEntity": "uploadedObjectId" }, { - "name" : "find", - "object" : "bucket0_files_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_files_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$matchesEntity" : "uploadedObjectId" + "_id": { + "$$matchesEntity": "uploadedObjectId" }, - "length" : 3, - "chunkSize" : 4, - "uploadDate" : { - "$$type" : "date" + "length": 3, + "chunkSize": 4, + "uploadDate": { + "$$type": "date" }, - "md5" : { - "$$unsetOrMatches" : "bafae3a174ab91fc70db7a6aa50f4f52" + "md5": { + "$$unsetOrMatches": "bafae3a174ab91fc70db7a6aa50f4f52" }, - "filename" : "filename" + "filename": "filename" } ] }, { - "name" : "find", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$type" : "objectId" + "_id": { + "$$type": "objectId" }, - "files_id" : { - "$$matchesEntity" : "uploadedObjectId" + "files_id": { + "$$matchesEntity": "uploadedObjectId" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIz", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIz", + "subType": "00" } } } @@ -234,65 +234,65 @@ ] }, { - "description" : "upload when length is 4", - "operations" : [ + "description": "upload when length is 4", + "operations": [ { - "name" : "upload", - "object" : "bucket0", - "arguments" : { - "filename" : "filename", - "source" : { - "$$hexBytes" : "11223344" + "name": "upload", + "object": "bucket0", + "arguments": { + "filename": "filename", + "source": { + "$$hexBytes": "11223344" }, - "chunkSizeBytes" : 4 + "chunkSizeBytes": 4 }, - "expectResult" : { - "$$type" : "objectId" + "expectResult": { + "$$type": "objectId" }, - "saveResultAsEntity" : "uploadedObjectId" + "saveResultAsEntity": "uploadedObjectId" }, { - "name" : "find", - "object" : "bucket0_files_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_files_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$matchesEntity" : "uploadedObjectId" + "_id": { + "$$matchesEntity": "uploadedObjectId" }, - "length" : 4, - "chunkSize" : 4, - "uploadDate" : { - "$$type" : "date" + "length": 4, + "chunkSize": 4, + "uploadDate": { + "$$type": "date" }, - "md5" : { - "$$unsetOrMatches" : "7e7c77cff5705d1f7574a25ef6662117" + "md5": { + "$$unsetOrMatches": "7e7c77cff5705d1f7574a25ef6662117" }, - "filename" : "filename" + "filename": "filename" } ] }, { - "name" : "find", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$type" : "objectId" + "_id": { + "$$type": "objectId" }, - "files_id" : { - "$$matchesEntity" : "uploadedObjectId" + "files_id": { + "$$matchesEntity": "uploadedObjectId" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } } @@ -301,83 +301,83 @@ ] }, { - "description" : "upload when length is 5", - "operations" : [ + "description": "upload when length is 5", + "operations": [ { - "name" : "upload", - "object" : "bucket0", - "arguments" : { - "filename" : "filename", - "source" : { - "$$hexBytes" : "1122334455" + "name": "upload", + "object": "bucket0", + "arguments": { + "filename": "filename", + "source": { + "$$hexBytes": "1122334455" }, - "chunkSizeBytes" : 4 + "chunkSizeBytes": 4 }, - "expectResult" : { - "$$type" : "objectId" + "expectResult": { + "$$type": "objectId" }, - "saveResultAsEntity" : "uploadedObjectId" + "saveResultAsEntity": "uploadedObjectId" }, { - "name" : "find", - "object" : "bucket0_files_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_files_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$matchesEntity" : "uploadedObjectId" + "_id": { + "$$matchesEntity": "uploadedObjectId" }, - "length" : 5, - "chunkSize" : 4, - "uploadDate" : { - "$$type" : "date" + "length": 5, + "chunkSize": 4, + "uploadDate": { + "$$type": "date" }, - "md5" : { - "$$unsetOrMatches" : "283d4fea5dded59cf837d3047328f5af" + "md5": { + "$$unsetOrMatches": "283d4fea5dded59cf837d3047328f5af" }, - "filename" : "filename" + "filename": "filename" } ] }, { - "name" : "find", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : {}, - "sort" : { - "n" : 1 + "name": "find", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": {}, + "sort": { + "n": 1 } }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$type" : "objectId" + "_id": { + "$$type": "objectId" }, - "files_id" : { - "$$matchesEntity" : "uploadedObjectId" + "files_id": { + "$$matchesEntity": "uploadedObjectId" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } }, { - "_id" : { - "$$type" : "objectId" + "_id": { + "$$type": "objectId" }, - "files_id" : { - "$$matchesEntity" : "uploadedObjectId" + "files_id": { + "$$matchesEntity": "uploadedObjectId" }, - "n" : 1, - "data" : { - "$binary" : { - "base64" : "VQ==", - "subType" : "00" + "n": 1, + "data": { + "$binary": { + "base64": "VQ==", + "subType": "00" } } } @@ -386,83 +386,83 @@ ] }, { - "description" : "upload when length is 8", - "operations" : [ + "description": "upload when length is 8", + "operations": [ { - "name" : "upload", - "object" : "bucket0", - "arguments" : { - "filename" : "filename", - "source" : { - "$$hexBytes" : "1122334455667788" + "name": "upload", + "object": "bucket0", + "arguments": { + "filename": "filename", + "source": { + "$$hexBytes": "1122334455667788" }, - "chunkSizeBytes" : 4 + "chunkSizeBytes": 4 }, - "expectResult" : { - "$$type" : "objectId" + "expectResult": { + "$$type": "objectId" }, - "saveResultAsEntity" : "uploadedObjectId" + "saveResultAsEntity": "uploadedObjectId" }, { - "name" : "find", - "object" : "bucket0_files_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_files_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$matchesEntity" : "uploadedObjectId" + "_id": { + "$$matchesEntity": "uploadedObjectId" }, - "length" : 8, - "chunkSize" : 4, - "uploadDate" : { - "$$type" : "date" + "length": 8, + "chunkSize": 4, + "uploadDate": { + "$$type": "date" }, - "md5" : { - "$$unsetOrMatches" : "dd254cdc958e53abaa67da9f797125f5" + "md5": { + "$$unsetOrMatches": "dd254cdc958e53abaa67da9f797125f5" }, - "filename" : "filename" + "filename": "filename" } ] }, { - "name" : "find", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : {}, - "sort" : { - "n" : 1 + "name": "find", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": {}, + "sort": { + "n": 1 } }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$type" : "objectId" + "_id": { + "$$type": "objectId" }, - "files_id" : { - "$$matchesEntity" : "uploadedObjectId" + "files_id": { + "$$matchesEntity": "uploadedObjectId" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "ESIzRA==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" } } }, { - "_id" : { - "$$type" : "objectId" + "_id": { + "$$type": "objectId" }, - "files_id" : { - "$$matchesEntity" : "uploadedObjectId" + "files_id": { + "$$matchesEntity": "uploadedObjectId" }, - "n" : 1, - "data" : { - "$binary" : { - "base64" : "VWZ3iA==", - "subType" : "00" + "n": 1, + "data": { + "$binary": { + "base64": "VWZ3iA==", + "subType": "00" } } } @@ -471,71 +471,71 @@ ] }, { - "description" : "upload when metadata is provided", - "operations" : [ + "description": "upload when metadata is provided", + "operations": [ { - "name" : "upload", - "object" : "bucket0", - "arguments" : { - "filename" : "filename", - "source" : { - "$$hexBytes" : "11" + "name": "upload", + "object": "bucket0", + "arguments": { + "filename": "filename", + "source": { + "$$hexBytes": "11" }, - "chunkSizeBytes" : 4, - "metadata" : { - "x" : 1 + "chunkSizeBytes": 4, + "metadata": { + "x": 1 } }, - "expectResult" : { - "$$type" : "objectId" + "expectResult": { + "$$type": "objectId" }, - "saveResultAsEntity" : "uploadedObjectId" + "saveResultAsEntity": "uploadedObjectId" }, { - "name" : "find", - "object" : "bucket0_files_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_files_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$matchesEntity" : "uploadedObjectId" + "_id": { + "$$matchesEntity": "uploadedObjectId" }, - "length" : 1, - "chunkSize" : 4, - "uploadDate" : { - "$$type" : "date" + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$$type": "date" }, - "md5" : { - "$$unsetOrMatches" : "47ed733b8d10be225eceba344d533586" + "md5": { + "$$unsetOrMatches": "47ed733b8d10be225eceba344d533586" }, - "filename" : "filename", - "metadata" : { - "x" : 1 + "filename": "filename", + "metadata": { + "x": 1 } } ] }, { - "name" : "find", - "object" : "bucket0_chunks_collection", - "arguments" : { - "filter" : {} + "name": "find", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": {} }, - "expectResult" : [ + "expectResult": [ { - "_id" : { - "$$type" : "objectId" + "_id": { + "$$type": "objectId" }, - "files_id" : { - "$$matchesEntity" : "uploadedObjectId" + "files_id": { + "$$matchesEntity": "uploadedObjectId" }, - "n" : 0, - "data" : { - "$binary" : { - "base64" : "EQ==", - "subType" : "00" + "n": 0, + "data": { + "$binary": { + "base64": "EQ==", + "subType": "00" } } } From 2fd511294a43d022d96ac202657d9904f5470f47 Mon Sep 17 00:00:00 2001 From: joykim1005 <81274936+joykim1005@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:00:43 -0500 Subject: [PATCH 3/3] Delete data/.mlaunch_startup --- data/.mlaunch_startup | 71 ------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 data/.mlaunch_startup diff --git a/data/.mlaunch_startup b/data/.mlaunch_startup deleted file mode 100644 index c061b70e7b8..00000000000 --- a/data/.mlaunch_startup +++ /dev/null @@ -1,71 +0,0 @@ -{ -"protocol_version": 2, -"mtools_version": "1.7.2", -"parsed_args": { -"no_progressbar": false, -"command": "init", -"single": true, -"replicaset": false, -"nodes": 3, -"arbiter": false, -"name": "replset", -"priority": false, -"sharded": null, -"config": 1, -"csrs": true, -"mongos": 1, -"verbose": false, -"port": 27017, -"binarypath": null, -"dir": "/Users/joykim/mongo-java-driver/data", -"hostname": "localhost", -"auth": false, -"username": "user", -"password": "password", -"auth_db": "admin", -"auth_roles": [ -"dbAdminAnyDatabase", -"readWriteAnyDatabase", -"userAdminAnyDatabase", -"clusterAdmin" -], -"auth_role_docs": false, -"initial-user": true, -"tlsCAFile": null, -"tlsCRLFile": null, -"tlsAllowInvalidHostnames": false, -"tlsAllowInvalidCertificates": false, -"tlsMode": null, -"tlsCertificateKeyFile": null, -"tlsCertificateKeyFilePassword": null, -"tlsClusterFile": null, -"tlsClusterPassword": null, -"tlsDisabledProtocols": null, -"tlsAllowConnectionsWithoutCertificates": false, -"tlsFIPSMode": false, -"tlsClientCertificateKeyFile": null, -"tlsClientCertificateKeyFilePassword": null, -"sslCAFile": null, -"sslCRLFile": null, -"sslAllowInvalidHostnames": false, -"sslAllowInvalidCertificates": false, -"sslMode": null, -"sslPEMKeyFile": null, -"sslPEMKeyPassword": null, -"sslClusterFile": null, -"sslClusterPassword": null, -"sslDisabledProtocols": null, -"sslAllowConnectionsWithoutCertificates": false, -"sslFIPSMode": false, -"sslClientCertificate": null, -"sslClientPEMKeyFile": null, -"sslClientPEMKeyPassword": null -}, -"unknown_args": [ -"--setParameter", -"enableTestCommands=1" -], -"startup_info": { -"27017": "\"mongod\" --dbpath \"/Users/joykim/mongo-java-driver/data/db\" --logpath \"/Users/joykim/mongo-java-driver/data/mongod.log\" --port 27017 --fork --setParameter \"enableTestCommands=1\" --wiredTigerCacheSizeGB 1 " -} -} \ No newline at end of file