From e09058ed3248a33a4ac44baf3e3ff4322e6029a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Mon, 28 Oct 2024 11:16:58 +0100 Subject: [PATCH] DRIVERS-2976 Remove md5, contentType and aliases from GridFS files --- source/gridfs/gridfs-spec.md | 1 + source/gridfs/tests/delete.json | 60 --------------------- source/gridfs/tests/delete.yml | 12 ----- source/gridfs/tests/download.json | 18 ------- source/gridfs/tests/download.yml | 18 ------- source/gridfs/tests/downloadByName.json | 15 ------ source/gridfs/tests/downloadByName.yml | 15 ------ source/gridfs/tests/upload.json | 69 ------------------------- source/gridfs/tests/upload.yml | 32 ------------ 9 files changed, 1 insertion(+), 239 deletions(-) diff --git a/source/gridfs/gridfs-spec.md b/source/gridfs/gridfs-spec.md index e65ad6bb43..fc3b1b257e 100644 --- a/source/gridfs/gridfs-spec.md +++ b/source/gridfs/gridfs-spec.md @@ -1042,6 +1042,7 @@ system?") it is a potential area of growth for the future. ## Changelog +- 2024-10-28: Removed deprecated fields from tests: `md5`, `contentType`, `aliases` - 2024-02-27: Migrated from reStructuredText to Markdown. - 2016-05-10: Support custom file ids - 2016-10-07: Drivers SHOULD handle any numeric type of length and chunkSize diff --git a/source/gridfs/tests/delete.json b/source/gridfs/tests/delete.json index 7a4ec27f88..277b9ed7e1 100644 --- a/source/gridfs/tests/delete.json +++ b/source/gridfs/tests/delete.json @@ -49,10 +49,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -64,10 +61,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -79,10 +73,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -94,10 +85,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "dd254cdc958e53abaa67da9f797125f5", "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} } ] @@ -197,10 +185,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -212,10 +197,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -227,10 +209,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "dd254cdc958e53abaa67da9f797125f5", "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} } ] @@ -330,10 +309,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -345,10 +321,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -360,10 +333,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "dd254cdc958e53abaa67da9f797125f5", "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} } ] @@ -448,10 +418,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -463,10 +430,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -478,10 +442,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} } ] @@ -554,10 +515,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -569,10 +527,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -584,10 +539,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -599,10 +551,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "dd254cdc958e53abaa67da9f797125f5", "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} } ] @@ -719,10 +668,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -734,10 +680,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -749,10 +692,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} } ] diff --git a/source/gridfs/tests/delete.yml b/source/gridfs/tests/delete.yml index b300cad1bc..8cefbfc15a 100644 --- a/source/gridfs/tests/delete.yml +++ b/source/gridfs/tests/delete.yml @@ -30,40 +30,28 @@ initialData: length: 0 chunkSize: 4 uploadDate: { "$date": "1970-01-01T00:00:00.000Z" } - md5: "d41d8cd98f00b204e9800998ecf8427e" filename: "length-0" - contentType: "application/octet-stream" - aliases: [] metadata: {} - &file2 _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: {} - &file3 _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: {} - &file4 _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: {} - collectionName: *bucket0_chunks_collectionName databaseName: *database0Name diff --git a/source/gridfs/tests/download.json b/source/gridfs/tests/download.json index 48d3246218..f0cb851708 100644 --- a/source/gridfs/tests/download.json +++ b/source/gridfs/tests/download.json @@ -49,10 +49,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -64,10 +61,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "d41d8cd98f00b204e9800998ecf8427e", "filename": "length-0-with-empty-chunk", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -79,10 +73,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", "filename": "length-2", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -94,10 +85,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "dd254cdc958e53abaa67da9f797125f5", "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -109,10 +97,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "57d83cd477bfb1ccd975ab33d827a92b", "filename": "length-10", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -124,9 +109,6 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "c700ed4fdb1d27055aa3faa2c2432283", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} } ] diff --git a/source/gridfs/tests/download.yml b/source/gridfs/tests/download.yml index 3da5ee950f..27dcdd005a 100644 --- a/source/gridfs/tests/download.yml +++ b/source/gridfs/tests/download.yml @@ -29,55 +29,37 @@ initialData: 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": "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": "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": "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": "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": "000000000000000000000006" } length: 2 chunkSize: 4 uploadDate: { "$date": "1970-01-01T00:00:00.000Z" } - md5: "c700ed4fdb1d27055aa3faa2c2432283" # filename is intentionally omitted - contentType: "application/octet-stream" - aliases: [] metadata: {} - collectionName: *bucket0_chunks_collectionName databaseName: *database0Name diff --git a/source/gridfs/tests/downloadByName.json b/source/gridfs/tests/downloadByName.json index cd44663957..7b20933c16 100644 --- a/source/gridfs/tests/downloadByName.json +++ b/source/gridfs/tests/downloadByName.json @@ -49,10 +49,7 @@ "uploadDate": { "$date": "1970-01-01T00:00:00.000Z" }, - "md5": "47ed733b8d10be225eceba344d533586", "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -64,10 +61,7 @@ "uploadDate": { "$date": "1970-01-02T00:00:00.000Z" }, - "md5": "b15835f133ff2e27c7cb28117bfae8f4", "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -79,10 +73,7 @@ "uploadDate": { "$date": "1970-01-03T00:00:00.000Z" }, - "md5": "eccbc87e4b5ce2fe28308fd9f2a7baf3", "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -94,10 +85,7 @@ "uploadDate": { "$date": "1970-01-04T00:00:00.000Z" }, - "md5": "f623e75af30e62bbd73d6df5b50bb7b5", "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} }, { @@ -109,10 +97,7 @@ "uploadDate": { "$date": "1970-01-05T00:00:00.000Z" }, - "md5": "4c614360da93c0a041b22e537de151eb", "filename": "abc", - "contentType": "application/octet-stream", - "aliases": [], "metadata": {} } ] diff --git a/source/gridfs/tests/downloadByName.yml b/source/gridfs/tests/downloadByName.yml index 6dfc602b66..81226df8c4 100644 --- a/source/gridfs/tests/downloadByName.yml +++ b/source/gridfs/tests/downloadByName.yml @@ -29,46 +29,31 @@ initialData: length: 1 chunkSize: 4 uploadDate: { $date: "1970-01-01T00:00:00.000Z" } - md5: "47ed733b8d10be225eceba344d533586" filename: "abc" - contentType: "application/octet-stream" - aliases: [] metadata: {} - _id: { $oid: "000000000000000000000002" } length: 1 chunkSize: 4 uploadDate: { $date: "1970-01-02T00:00:00.000Z" } - md5: "b15835f133ff2e27c7cb28117bfae8f4" filename: "abc" - contentType: "application/octet-stream" - aliases: [] metadata: {} - _id: { $oid: "000000000000000000000003" } length: 1 chunkSize: 4 uploadDate: { $date: "1970-01-03T00:00:00.000Z" } - md5: "eccbc87e4b5ce2fe28308fd9f2a7baf3" filename: "abc" - contentType: "application/octet-stream" - aliases: [] metadata: {} - _id: { $oid: "000000000000000000000004" } length: 1 chunkSize: 4 uploadDate: { $date: "1970-01-04T00:00:00.000Z" } - md5: "f623e75af30e62bbd73d6df5b50bb7b5" filename: "abc" - contentType: "application/octet-stream" - aliases: [] metadata: {} - _id: { $oid: "000000000000000000000005" } length: 1 chunkSize: 4 uploadDate: { $date: "1970-01-05T00:00:00.000Z" } - md5: "4c614360da93c0a041b22e537de151eb" filename: "abc" - contentType: "application/octet-stream" - aliases: [] metadata: {} - collectionName: *bucket0_chunks_collectionName databaseName: *database0Name diff --git a/source/gridfs/tests/upload.json b/source/gridfs/tests/upload.json index 97e18d2bc2..3c1644653a 100644 --- a/source/gridfs/tests/upload.json +++ b/source/gridfs/tests/upload.json @@ -470,75 +470,6 @@ } ] }, - { - "description": "upload when contentType is provided", - "operations": [ - { - "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": [ diff --git a/source/gridfs/tests/upload.yml b/source/gridfs/tests/upload.yml index 27f3186fc4..96fc5e9863 100644 --- a/source/gridfs/tests/upload.yml +++ b/source/gridfs/tests/upload.yml @@ -222,38 +222,6 @@ tests: files_id: { $$matchesEntity: *uploadedObjectId } n: 1 data: { $binary: { base64: "VWZ3iA==", subType: "00" } } # hex 55667788 - - description: "upload when contentType is provided" - operations: - - 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" } } # hex 11 - description: "upload when metadata is provided" operations: - name: upload