MongoDB & Java Driver: Range Query -



MongoDB & Java Driver: Range Query -

i have database of documents contain numerical field x. attempting write query returns specified number of documents x fields closest given value y.

e.g. list of x documents [1, 4, 9, 2, 5, 4, 6, 8, 9, 10, 23, 2] y 5, specified number of results homecoming 6 homecoming [4, 4, 5, 6, 8, 9]

my initial thought of documents, sort result set x, , trim excess entries around y. i'm not sure how implement "trimming" functionality in mongo, however.

how can go crafting query using java driver this?

there nil mongodb help you. have implement such filtering on application level or perhaps utilize map-reduce standard client-side query api not help here (unlikely implement using sql).

java mongodb

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -