[SERVER-3483] $timestamp extended json format for dumping parts of the oplog Created: 26/Jul/11  Updated: 12/Jul/16  Resolved: 02/Dec/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 2.1.0

Type: New Feature Priority: Major - P3
Reporter: Kristina Chodorow (Inactive) Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: rn
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-6812 Extended JSON syntax should support a... Closed
Participants:

 Comments   
Comment by Kay Agahd [ 31/Jul/13 ]

I've found this related issue, which solved my problem:
https://jira.mongodb.org/browse/SERVER-6564

If this bug is fixed in v2.3.2 as stated in the above jira, you may left this issue closed.

Comment by Kay Agahd [ 30/Jul/13 ]

Please reopen since it doesn't seem to work.

mongodump fails using $timestamp as you can see here:

ws30607:~$ mongodump --host localhost:27017 --db local --collection oplog.rs --query '{ts:{$timestamp:{t:1375112528000,i:9250}}}'
connected to: localhost:27017
Tue Jul 30 16:19:28 DATABASE: local     to     dump/local
Tue Jul 30 16:19:28     local.oplog.rs to dump/local/oplog.rs.bson
assertion: 13106 nextSafe(): { $err: "invalid operator: $timestamp", code: 10068 }

I'm able to use Timestamp expression in mongo shell:

foo:PRIMARY> db.oplog.rs.findOne({ts:Timestamp(1375112528000,9250)})
{
	"ts" : Timestamp(1375112528000, 9250),
	"h" : NumberLong("2100525891749123327"),
	"v" : 2,
	"op" : "c",
	"ns" : "test.$cmd",
	"o" : {
		"applyOps" : [
			{
				"ts" : Timestamp(1375112018000, 12343),
				"h" : NumberLong("-3681457038055808883"),
				"v" : 2,
				"op" : "i",
				"ns" : "test.dummy",
				"o" : {
					"_id" : ObjectId("51f68b52727fe7e7be586fc0"),
					"name" : "test",
					"count" : 28021
				}
			}
		]
	}
}

However, using Timestamp by mongodump fails in the same manner as $timestamp failed above already:

ws30607:~$ mongodump --host localhost:27017 --db local --collection oplog.rs --query '{ts:Timestamp(1375112528000,9250)}'
connected to: localhost:27017
Tue Jul 30 16:18:07 Assertion: 10340:Failure parsing JSON string near: ts:Timesta
0xafb7d1 0xac3109 0xac328c 0x7be78d 0x7bec2e 0x567b9e 0xac0052 0x5549e2 0x7fbf64bd8c4d 0x554849
 mongodump(_ZN5mongo15printStackTraceERSo+0x21) [0xafb7d1]
 mongodump(_ZN5mongo11msgassertedEiPKc+0x99) [0xac3109]
 mongodump() [0xac328c]
 mongodump(_ZN5mongo8fromjsonEPKcPi+0x56d) [0x7be78d]
 mongodump(_ZN5mongo8fromjsonERKSs+0xe) [0x7bec2e]
 mongodump(_ZN4Dump3runEv+0x33e) [0x567b9e]
 mongodump(_ZN5mongo4Tool4mainEiPPc+0x1712) [0xac0052]
 mongodump(main+0x32) [0x5549e2]
 /lib/libc.so.6(__libc_start_main+0xfd) [0x7fbf64bd8c4d]
 mongodump(__gxx_personality_v0+0x419) [0x554849]
assertion: 10340 Failure parsing JSON string near: ts:Timesta

PS: tested on v2.2.3 and v2.2.1 on Linux 64 Bit

Comment by auto [ 13/Jul/12 ]

Author:

{u'date': u'2012-07-13T07:19:56-07:00', u'email': u'ian.whalen@gmail.com', u'name': u'Ian Whalen'}

Message: Merge pull request #256 from jmikola/timestamp-jstest

SERVER-3483 JS test for Timestamp JSON wrapper
Branch: master
https://github.com/mongodb/mongo/commit/8afb1275f3384432a1be43ae7f0e56d8d1b46365

Comment by auto [ 13/Jul/12 ]

Author:

{u'date': u'2012-07-02T08:48:50-07:00', u'email': u'jmikola@gmail.com', u'name': u'Jeremy Mikola'}

Message: SERVER-3483 JS test for Timestamp JSON wrapper
Branch: master
https://github.com/mongodb/mongo/commit/a66c6f418b40d25702d2a4f4c2064559e04666df

Comment by Eric Milkie [ 02/Dec/11 ]

This was complete back in July.
Commit 35f1a722 allows the unit test for this feature to run on Windows.

Comment by Eliot Horowitz (Inactive) [ 26/Jul/11 ]

What's the before and after?

Generated at Thu Feb 08 03:03:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.