diff options
author | Spencer T Brody <spencer@10gen.com> | 2011-09-27 17:11:52 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-10-08 23:33:49 -0400 |
commit | 0f605b5ab37adaa3caa6bfb2ff3526b8202c94dc (patch) | |
tree | efc93b3af1fffff4c2a698722b521ee6c3295f0b /jstests/tool/exportimport3.js | |
parent | 35a196a13eee474f3a5b8e401507173ce885d4ed (diff) | |
download | mongo-0f605b5ab37adaa3caa6bfb2ff3526b8202c94dc.tar.gz |
Fix mongoimport on jsonArrays. SERVER-3834
Diffstat (limited to 'jstests/tool/exportimport3.js')
-rw-r--r-- | jstests/tool/exportimport3.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/jstests/tool/exportimport3.js b/jstests/tool/exportimport3.js new file mode 100644 index 00000000000..f18ba6cbd4b --- /dev/null +++ b/jstests/tool/exportimport3.js @@ -0,0 +1,27 @@ +// exportimport3.js + +t = new ToolTest( "exportimport3" ); + +c = t.startDB( "foo" ); +assert.eq( 0 , c.count() , "setup1" ); +c.save({a:1}) +c.save({a:2}) +c.save({a:3}) +c.save({a:4}) +c.save({a:5}) + +assert.eq( 5 , c.count() , "setup2" ); + + +t.runTool( "export" , "--jsonArray" , "--out" , t.extFile , "-d" , t.baseName , "-c" , "foo" ); + +c.drop(); +assert.eq( 0 , c.count() , "after drop" , "-d" , t.baseName , "-c" , "foo" );; + +t.runTool( "import" , "--jsonArray" , "--file" , t.extFile , "-d" , t.baseName , "-c" , "foo" ); + +assert.soon( "c.findOne()" , "no data after sleep" ); +assert.eq( 5 , c.count() , "after restore 2" ); + + +t.stop(); |