Skip to content

Commit

Permalink
better $timestamp format
Browse files Browse the repository at this point in the history
  • Loading branch information
kchodorow committed Sep 28, 2011
1 parent 14925b2 commit f40de80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion db/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ namespace mongo {
dbrefT = str_p( "Dbref" ) >> '(' >> str[ dbrefNS( self.b ) ] >> ',' >>
quotedOid >> ')';

timestamp = ch_p( '{' ) >> "\"$timestamp\"" >> ':' >> '{' >> uint_parser<unsigned long long, 10, 1, -1>()[ timestampSecs(self.b) ] >> ',' >> uint_parser<unsigned int, 10, 1, -1>()[ timestampInc(self.b) ] >> '}' >>'}';
timestamp = ch_p( '{' ) >> "\"$timestamp\"" >> ':' >> '{' >>
"\"t\"" >> ':' >> uint_parser<unsigned long long, 10, 1, -1>()[ timestampSecs(self.b) ] >> ',' >>
"\"i\"" >> ':' >> uint_parser<unsigned int, 10, 1, -1>()[ timestampInc(self.b) ] >> '}' >>'}';

oid = oidS | oidT;
oidS = ch_p( '{' ) >> "\"$oid\"" >> ':' >> quotedOid >> '}';
Expand Down
2 changes: 1 addition & 1 deletion jstests/tool/dumprestore7.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var master = replTest.getMaster();
step("try mongodump with $timestamp");

var data = "/data/db/dumprestore7-dump1/";
var query = "{\"ts\":{\"$gt\":{\"$timestamp\" : {"+ time.ts.t + "," + time.ts.i +" }}}}";
var query = "{\"ts\":{\"$gt\":{\"$timestamp\" : {\"t\":"+ time.ts.t + ",\"i\":" + time.ts.i +" }}}}";

runMongoProgram( "mongodump", "--host", "127.0.0.1:"+replTest.ports[0], "--db", "local", "--collection", "oplog.rs", "--query", query, "--out", data );

Expand Down

0 comments on commit f40de80

Please sign in to comment.