Different values returned for the same query in Nosqlbooster

Guest shared this problem 4 years ago
Solved

We have a query that is executed in some moments returns the document and in others it does not return anything. The same happens when we execute a count, that sometimes returns 0 and in others returns 1. We execute the same query by the shell and in all the executions the value returned of the cout was 1. We test in different machines, different OS and the problem continues. We use the most current version of NoSQLBooster to 5.1.7.


Note: The document has not been deleted or updated during the tests.

Replies (3)

photo
1

Thanks for opening your issue here! From your description, it is difficult for me to guess what the problem is.

If you're reporting a bug, please make sure you include steps to reproduce it.

  • NoSQLBooster Version
  • Operating System (Windows/Mac/Ubuntu):
  • MongoDB Version
  • Expected Behavior
  • Actual Behavior
  • How to Reproduce (Please attach sample JSON data)

photo
1

In the search filter it uses a pid field which is a shardkey so it does not access all shards, but the document is in shard7 and when it returns nothing it examines only shard5 or shard2.

The same problem does not happen in the mongo shell.


NoSQLBooster Version: 5.1.7

Operating System (Windows/Mac/Ubuntu): Windows 10 / Ubuntu 18

MongoDB Version: 3.6.8

Expected Behavior: Return 1 document in a shard cluster

Actual Behavior: Sometimes it returns and in others it does not return

How to Reproduce (Please attach sample JSON data): 9 shards cluster, collection with bilions documents, indexes: {pid: 'hashed"}, {"pid": 1, universe_id: 1, account_id: 1, channel:1, normalized_shared_at:1}


{
	"executionStats" : {
		"nReturned" : 0,
		"executionTimeMillis" : 37,
		"totalKeysExamined" : 0,
		"totalDocsExamined" : 0,
		"executionStages" : {
			"stage" : "SINGLE_SHARD",
			"nReturned" : 0,
			"executionTimeMillis" : 37,
			"totalKeysExamined" : 0,
			"totalDocsExamined" : 0,
			"totalChildMillis" : 32,
			"shards" : [
				{
					"shardName" : "EndpoingGoogleShard_2",
					"executionSuccess" : true,
					"executionStages" : {
						"stage" : "FETCH",
						"nReturned" : 0,
						"executionTimeMillisEstimate" : 10,
						"works" : 2,
						"advanced" : 0,
						"needTime" : 0,
						"needYield" : 0,
						"saveState" : 1,
						"restoreState" : 1,
						"isEOF" : 1,
						"invalidates" : 0,
						"docsExamined" : 0,
						"alreadyHasObj" : 0,
						"inputStage" : {
							"stage" : "IXSCAN",
							"nReturned" : 0,
							"executionTimeMillisEstimate" : 10,
							"works" : 1,
							"advanced" : 0,
							"needTime" : 0,
							"needYield" : 0,
							"saveState" : 1,
							"restoreState" : 1,
							"isEOF" : 1,
							"invalidates" : 0,
							"keyPattern" : {
								"pid" : 1,
								"universe_id" : 1,
								"account_id" : 1,
								"channel" : 1,
								"normalized_shared_at" : 1
							},
							"indexName" : "pid_shared_at",
							"isMultiKey" : false,
							"multiKeyPaths" : {
								"pid" : [ ],
								"universe_id" : [ ],
								"account_id" : [ ],
								"channel" : [ ],
								"normalized_shared_at" : [ ]
							},
							"isUnique" : false,
							"isSparse" : false,
							"isPartial" : false,
							"indexVersion" : 2,
							"direction" : "forward",
							"indexBounds" : {
								"pid" : [
									"[\"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\", \"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\"]"
								],
								"universe_id" : [
									"[4706392142249984.0, 4706392142249984.0]"
								],
								"account_id" : [
									"[5215959685005312.0, 5215959685005312.0]"
								],
								"channel" : [
									"[MinKey, MaxKey]"
								],
								"normalized_shared_at" : [
									"[MinKey, MaxKey]"
								]
							},
							"keysExamined" : 0,
							"seeks" : 1,
							"dupsTested" : 0,
							"dupsDropped" : 0,
							"seenInvalidated" : 0,
							"indexDef" : {
								"indexName" : "pid_shared_at",
								"isMultiKey" : false,
								"multiKeyPaths" : {
									"pid" : [ ],
									"universe_id" : [ ],
									"account_id" : [ ],
									"channel" : [ ],
									"normalized_shared_at" : [ ]
								},
								"keyPattern" : {
									"pid" : 1,
									"universe_id" : 1,
									"account_id" : 1,
									"channel" : 1,
									"normalized_shared_at" : 1
								},
								"isUnique" : false,
								"isSparse" : false,
								"isPartial" : false,
								"direction" : "forward"
							}
						}
					}
				}
			]
		}
	},
	"ok" : 1,
	"operationTime" : Timestamp(1558710633, 1601),
	"$clusterTime" : {
		"clusterTime" : Timestamp(1558710633, 1709),
		"signature" : {
			"hash" : BinData(0,"6HHjPqv9rADBkaFV3mKFGDa9bFw="),
			"keyId" : NumberLong("6666498389737209860")
		}
	}
}











{
	"executionStats" : {
		"nReturned" : 0,
		"executionTimeMillis" : 16,
		"totalKeysExamined" : 0,
		"totalDocsExamined" : 0,
		"executionStages" : {
			"stage" : "SINGLE_SHARD",
			"nReturned" : 0,
			"executionTimeMillis" : 16,
			"totalKeysExamined" : 0,
			"totalDocsExamined" : 0,
			"totalChildMillis" : 12,
			"shards" : [
				{
					"shardName" : "EndpoingGoogleShard_5",
					"executionSuccess" : true,
					"executionStages" : {
						"stage" : "FETCH",
						"nReturned" : 0,
						"executionTimeMillisEstimate" : 0,
						"works" : 2,
						"advanced" : 0,
						"needTime" : 0,
						"needYield" : 0,
						"saveState" : 0,
						"restoreState" : 0,
						"isEOF" : 1,
						"invalidates" : 0,
						"docsExamined" : 0,
						"alreadyHasObj" : 0,
						"inputStage" : {
							"stage" : "IXSCAN",
							"nReturned" : 0,
							"executionTimeMillisEstimate" : 0,
							"works" : 1,
							"advanced" : 0,
							"needTime" : 0,
							"needYield" : 0,
							"saveState" : 0,
							"restoreState" : 0,
							"isEOF" : 1,
							"invalidates" : 0,
							"keyPattern" : {
								"pid" : 1,
								"universe_id" : 1,
								"account_id" : 1,
								"channel" : 1,
								"normalized_shared_at" : 1
							},
							"indexName" : "pid_shared_at",
							"isMultiKey" : false,
							"multiKeyPaths" : {
								"pid" : [ ],
								"universe_id" : [ ],
								"account_id" : [ ],
								"channel" : [ ],
								"normalized_shared_at" : [ ]
							},
							"isUnique" : false,
							"isSparse" : false,
							"isPartial" : false,
							"indexVersion" : 2,
							"direction" : "forward",
							"indexBounds" : {
								"pid" : [
									"[\"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\", \"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\"]"
								],
								"universe_id" : [
									"[4706392142249984.0, 4706392142249984.0]"
								],
								"account_id" : [
									"[5215959685005312.0, 5215959685005312.0]"
								],
								"channel" : [
									"[MinKey, MaxKey]"
								],
								"normalized_shared_at" : [
									"[MinKey, MaxKey]"
								]
							},
							"keysExamined" : 0,
							"seeks" : 1,
							"dupsTested" : 0,
							"dupsDropped" : 0,
							"seenInvalidated" : 0
						}
					}
				}
			]
		}
	},
	"ok" : 1,
	"operationTime" : Timestamp(1558710931, 210),
	"$clusterTime" : {
		"clusterTime" : Timestamp(1558710931, 900),
		"signature" : {
			"hash" : BinData(0,"9LMxeW99uImtfUUcIj2e+OfbW/A="),
			"keyId" : NumberLong("6666498389737209860")
		}
	}
}






{
	"executionStats" : {
		"nReturned" : 1,
		"executionTimeMillis" : 13,
		"totalKeysExamined" : 1,
		"totalDocsExamined" : 1,
		"executionStages" : {
			"stage" : "SINGLE_SHARD",
			"nReturned" : 1,
			"executionTimeMillis" : 13,
			"totalKeysExamined" : 1,
			"totalDocsExamined" : 1,
			"totalChildMillis" : 10,
			"shards" : [
				{
					"shardName" : "EndpoingGoogleShard_7",
					"executionSuccess" : true,
					"executionStages" : {
						"stage" : "FETCH",
						"nReturned" : 1,
						"executionTimeMillisEstimate" : 0,
						"works" : 3,
						"advanced" : 1,
						"needTime" : 0,
						"needYield" : 0,
						"saveState" : 0,
						"restoreState" : 0,
						"isEOF" : 1,
						"invalidates" : 0,
						"docsExamined" : 1,
						"alreadyHasObj" : 0,
						"inputStage" : {
							"stage" : "IXSCAN",
							"nReturned" : 1,
							"executionTimeMillisEstimate" : 0,
							"works" : 2,
							"advanced" : 1,
							"needTime" : 0,
							"needYield" : 0,
							"saveState" : 0,
							"restoreState" : 0,
							"isEOF" : 1,
							"invalidates" : 0,
							"keyPattern" : {
								"pid" : 1,
								"universe_id" : 1,
								"account_id" : 1,
								"channel" : 1,
								"normalized_shared_at" : 1
							},
							"indexName" : "pid_shared_at",
							"isMultiKey" : false,
							"multiKeyPaths" : {
								"pid" : [ ],
								"universe_id" : [ ],
								"account_id" : [ ],
								"channel" : [ ],
								"normalized_shared_at" : [ ]
							},
							"isUnique" : false,
							"isSparse" : false,
							"isPartial" : false,
							"indexVersion" : 2,
							"direction" : "forward",
							"indexBounds" : {
								"pid" : [
									"[\"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\", \"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\"]"
								],
								"universe_id" : [
									"[4706392142249984.0, 4706392142249984.0]"
								],
								"account_id" : [
									"[5215959685005312.0, 5215959685005312.0]"
								],
								"channel" : [
									"[MinKey, MaxKey]"
								],
								"normalized_shared_at" : [
									"[MinKey, MaxKey]"
								]
							},
							"keysExamined" : 1,
							"seeks" : 1,
							"dupsTested" : 0,
							"dupsDropped" : 0,
							"seenInvalidated" : 0
						}
					}
				}
			]
		}
	},
	"ok" : 1,
	"operationTime" : Timestamp(1558710967, 1442),
	"$clusterTime" : {
		"clusterTime" : Timestamp(1558710968, 61),
		"signature" : {
			"hash" : BinData(0,"0GSN90ItfIwB8KOskIE7bAoRvpY="),
			"keyId" : NumberLong("6666498389737209860")
		}
	}
}

photo
1

Thanks.


  • Does your document only include the "executionStats" field?
  • Which MongoShell version are you using? 3.6.8?
  • Can you give me the query statement you are using? (e.g. db.cols.find({pid: xxxx}))

photo
1

yes, the mongo shell is in version 3.6.8

The query is db.cols.find ({{account_id: 12345, universe_id: 1234567, pid: "xxxx"})

follows the total output of explain:


{ 

"queryPlanner" : {

"mongosPlannerVersion" : 1,

"winningPlan" : {

"stage" : "SINGLE_SHARD",

"shards" : [

{

"shardName" : "EndpoingGoogleShard_5",

"connectionString" : "EndpoingGoogleShard_5/mongo-gcp-shard6a.stilingue.com.br:7308,mongo-gcp-shard6b.stilingue.com.br:7308,mongo-gcp-shard6c.stilingue.com.br:7308",

"serverInfo" : {

"host" : "mongo-gcp-shard6b",

"port" : 7308,

"version" : "3.6.8",

"gitVersion" : "6bc9ed599c3fa164703346a22bad17e33fa913e4"

},

"plannerVersion" : 1,

"namespace" : "shipyard.investigation_cards",

"indexFilterSet" : false,

"parsedQuery" : {

"$and" : [

{

"account_id" : {

"$eq" : 5215959685005312

}

},

{

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

{

"universe_id" : {

"$eq" : 4706392142249984

}

}

]

},

"winningPlan" : {

"stage" : "FETCH",

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"pid" : 1,

"universe_id" : 1,

"account_id" : 1,

"channel" : 1,

"normalized_shared_at" : 1

},

"indexName" : "pid_shared_at",

"isMultiKey" : false,

"multiKeyPaths" : {

"pid" : [ ],

"universe_id" : [ ],

"account_id" : [ ],

"channel" : [ ],

"normalized_shared_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"pid" : [

"[\"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\", \"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\"]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"channel" : [

"[MinKey, MaxKey]"

],

"normalized_shared_at" : [

"[MinKey, MaxKey]"

]

}

}

},

"rejectedPlans" : [

{

"stage" : "FETCH",

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"pid" : 1,

"channel" : 1,

"account_id" : 1,

"universe_id" : 1

},

"indexName" : "pid_1_channel_1",

"isMultiKey" : false,

"multiKeyPaths" : {

"pid" : [ ],

"channel" : [ ],

"account_id" : [ ],

"universe_id" : [ ]

},

"isUnique" : true,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"pid" : [

"[\"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\", \"m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw\"]"

],

"channel" : [

"[MinKey, MaxKey]"

],

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"user_score" : -1,

"normalized_posted_at" : -1

},

"indexName" : "sortIndexAAA",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"user_score" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"user_score" : [

"[MaxKey, MinKey]"

],

"normalized_posted_at" : [

"[MaxKey, MinKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"hot" : -1,

"normalized_posted_at" : -1

},

"indexName" : "sortIndexHot",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"hot" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"hot" : [

"[MaxKey, MinKey]"

],

"normalized_posted_at" : [

"[MaxKey, MinKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"type" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"normalized_posted_at" : 1

},

"indexName" : "type",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"type" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"type" : [

"[MinKey, MaxKey]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"normalized_posted_at" : [

"[MinKey, MaxKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"polarity" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"normalized_posted_at" : 1

},

"indexName" : "polarity",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"polarity" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"polarity" : [

"[MinKey, MaxKey]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"normalized_posted_at" : [

"[MinKey, MaxKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"device" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"normalized_posted_at" : 1

},

"indexName" : "device",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"device" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"device" : [

"[MinKey, MaxKey]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"normalized_posted_at" : [

"[MinKey, MaxKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"lang" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"normalized_posted_at" : 1

},

"indexName" : "lang",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"lang" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"lang" : [

"[MinKey, MaxKey]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"normalized_posted_at" : [

"[MinKey, MaxKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"normalized_posted_at" : 1

},

"indexName" : "basicIndex",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"normalized_posted_at" : [

"[MinKey, MaxKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"annotation_favorite" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"normalized_posted_at" : 1

},

"indexName" : "favorite",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"annotation_favorite" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : true,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"annotation_favorite" : [

"[MinKey, MaxKey]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"normalized_posted_at" : [

"[MinKey, MaxKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"annotation_updated_at" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"normalized_posted_at" : 1

},

"indexName" : "annotation_updated",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"annotation_updated_at" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : true,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"annotation_updated_at" : [

"[MinKey, MaxKey]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"normalized_posted_at" : [

"[MinKey, MaxKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"gender" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"normalized_posted_at" : 1

},

"indexName" : "gender",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"gender" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"gender" : [

"[MinKey, MaxKey]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"normalized_posted_at" : [

"[MinKey, MaxKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"interactions" : -1,

"normalized_posted_at" : -1

},

"indexName" : "sortIndexInteractions",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"interactions" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"interactions" : [

"[MaxKey, MinKey]"

],

"normalized_posted_at" : [

"[MaxKey, MinKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"likes_count" : -1,

"normalized_posted_at" : -1

},

"indexName" : "sortIndexLikes",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"likes_count" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"likes_count" : [

"[MaxKey, MinKey]"

],

"normalized_posted_at" : [

"[MaxKey, MinKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"shares_count" : -1,

"normalized_posted_at" : -1

},

"indexName" : "sortIndexShares",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"shares_count" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"shares_count" : [

"[MaxKey, MinKey]"

],

"normalized_posted_at" : [

"[MaxKey, MinKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"comments_count" : -1,

"normalized_posted_at" : -1

},

"indexName" : "sortIndexComments",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"comments_count" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"comments_count" : [

"[MaxKey, MinKey]"

],

"normalized_posted_at" : [

"[MaxKey, MinKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"user_followers" : -1,

"normalized_posted_at" : -1

},

"indexName" : "sortIndexFollowers",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"user_followers" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"user_followers" : [

"[MaxKey, MinKey]"

],

"normalized_posted_at" : [

"[MaxKey, MinKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"is_only_universe" : 1,

"max_shared_followers" : -1,

"normalized_posted_at" : -1

},

"indexName" : "sortIndexRetweetFollowers",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"is_only_universe" : [ ],

"max_shared_followers" : [ ],

"normalized_posted_at" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"is_only_universe" : [

"[MinKey, MaxKey]"

],

"max_shared_followers" : [

"[MaxKey, MinKey]"

],

"normalized_posted_at" : [

"[MaxKey, MinKey]"

]

}

}

},

{

"stage" : "FETCH",

"filter" : {

"pid" : {

"$eq" : "m_bUU3PbLyXYZYlWGnPZZVHV-kjCEQW6rTNT65mGu_n0cFLPDYVHjnAViCCMr9oi4q4c1kTxSriUEIr3njyU0MUw"

}

},

"inputStage" : {

"stage" : "IXSCAN",

"keyPattern" : {

"account_id" : 1,

"universe_id" : 1,

"has_name" : 1,

"annotation_spam" : 1,

"channel" : 1,

"user_followers" : 1

},

"indexName" : "aaaPostFollowersIndex",

"isMultiKey" : false,

"multiKeyPaths" : {

"account_id" : [ ],

"universe_id" : [ ],

"has_name" : [ ],

"annotation_spam" : [ ],

"channel" : [ ],

"user_followers" : [ ]

},

"isUnique" : false,

"isSparse" : false,

"isPartial" : false,

"indexVersion" : 2,

"direction" : "forward",

"indexBounds" : {

"account_id" : [

"[5215959685005312.0, 5215959685005312.0]"

],

"universe_id" : [

"[4706392142249984.0, 4706392142249984.0]"

],

"has_name" : [

"[MinKey, MaxKey]"

],

"annotation_spam" : [

"[MinKey, MaxKey]"

],

"channel" : [

"[MinKey,

photo
1

If you have a nodejs runtime environment, can you do a simple test for me, I want to confirm if the problem is caused by the nodejs mongodb driver.


1) Create a test project directory, and CD to this directory


2) Change MongoDB URI, DB name, collection name and save the following script as index.js


const mongodb = require("mongodb"); //npm i mongodb
const {
    MongoClient
} = mongodb;

//Created with NoSQLBooster, the essential IDE for MongoDB - https://nosqlbooster.com
async function main() {
    const client = await MongoClient.connect("mongodb://YOUR_SERVER:20017"); //YOUR MONGODB URI 
	
    const db = client.db("YOUR_DB");
	
    const docs = await db.collection("YOUR_COLLECTION").find({account_id: 12345, universe_id: 1234567, pid: "xxxx"})
        .toArray();

    console.log(docs.map(it => it._id));

    client.close();
}

main()


3) cmd > npm i mongodb@3.1.7 (NoSQLBooster uses this version)

4) cmd > node index.js


If mongodb@3.1.7 does not work, please unisntall mongodb@3.1.7 and install the mongodb@latest and try it again.

photo
Leave a Comment
 
Attach a file