summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/test/qa-tests/jstests/export/no_data.js
blob: cfc9248bb5f09620c5c09d916c9ade38dce6d3d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(function() {

  // Tests running mongoexport with no data in the target collection.

  jsTest.log('Testing exporting no data');

  var toolTest = new ToolTest('no_data');
  toolTest.startDB('foo');

  // run mongoexport with no data, make sure it doesn't error out
  var ret = toolTest.runTool('export', '--db', 'test', '--collection', 'data');
  assert.eq(0, ret);

  // but it should fail if --assertExists specified
  ret = toolTest.runTool('export', '--db', 'test', '--collection', 'data', '--assertExists');
  assert.neq(0, ret);

  // success
  toolTest.stop();

}());