minquery icon indicating copy to clipboard operation
minquery copied to clipboard

bug, index error

Open chensanle opened this issue 6 years ago • 1 comments

when I used index like “create_time.seconds” as a cursor field to query data, the program can't get the correct next page token, see the source code:

cursorData[i] = bson.DocElem{Name: cf, Value: doc[cf]}

It just assign "create_index.seconds" to doc and matching doc map, I think it should be look like this:

if cf == "create_time.seconds" {
    sonM, _ := doc["create_time"].(bson.M)
    cursorData[i] = bson.DocElem{Name: cf, Value: sonM["seconds"]}
} else {
    cursorData[i] = bson.DocElem{Name: cf, Value: doc[cf]}
}

Just a example~

chensanle avatar Oct 25 '19 12:10 chensanle

Can you provide a minimal, complete example that reproduces the issue you're having? Showing data models, example documents in MongoDB, how you query documents, what indices you have etc.

icza avatar Oct 29 '19 10:10 icza