diff options
Diffstat (limited to 'jstests/tool/gridfs.js')
-rw-r--r-- | jstests/tool/gridfs.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/jstests/tool/gridfs.js b/jstests/tool/gridfs.js index c144563c45b..5fbf6e6036b 100644 --- a/jstests/tool/gridfs.js +++ b/jstests/tool/gridfs.js @@ -1,15 +1,10 @@ // tests gridfs with a sharded fs.chunks collection. -var test = new ShardingTest({shards: 3, - mongos: 1, - config: 1, - verbose: 2, - other: {chunkSize:1}}); +var test = new ShardingTest({shards: 3, mongos: 1, config: 1, verbose: 2, other: {chunkSize: 1}}); var mongos = test.s0; - -var filename = "mongod"; // A large file we are guaranteed to have +var filename = "mongod"; // A large file we are guaranteed to have if (_isWindows()) filename += ".exe"; @@ -28,7 +23,7 @@ function testGridFS(name) { assert.eq(d.fs.files.count(), 1); var fileObj = d.fs.files.findOne(); print("fileObj: " + tojson(fileObj)); - assert.eq(rawmd5, fileObj.md5); //check that mongofiles inserted the correct md5 + assert.eq(rawmd5, fileObj.md5); // check that mongofiles inserted the correct md5 // Call filemd5 ourself and check results. var res = d.runCommand({filemd5: fileObj._id}); @@ -37,7 +32,7 @@ function testGridFS(name) { assert.eq(rawmd5, res.md5); var numChunks = d.fs.chunks.find({files_id: fileObj._id}).itcount(); - //var numChunks = d.fs.chunks.count({files_id: fileObj._id}) // this is broken for now + // var numChunks = d.fs.chunks.count({files_id: fileObj._id}) // this is broken for now assert.eq(numChunks, res.numChunks); } @@ -53,13 +48,13 @@ testGridFS(name); print('\n\n\t**** sharded collection on files_id ****\n\n'); name = 'sharded_files_id'; test.adminCommand({enablesharding: name}); -test.adminCommand({shardcollection: name+'.fs.chunks', key: {files_id:1}}); +test.adminCommand({shardcollection: name + '.fs.chunks', key: {files_id: 1}}); testGridFS(name); print('\n\n\t**** sharded collection on files_id,n ****\n\n'); name = 'sharded_files_id_n'; test.adminCommand({enablesharding: name}); -test.adminCommand({shardcollection: name+'.fs.chunks', key: {files_id:1, n:1}}); +test.adminCommand({shardcollection: name + '.fs.chunks', key: {files_id: 1, n: 1}}); testGridFS(name); test.stop(); |