Sort strange behaviour

7 views
Skip to first unread message

Nicolas Esteban

unread,
Oct 13, 2015, 11:19:48 AM10/13/15
to ReactiveMongo - http://reactivemongo.org
Hi,

Here is my query : 

peoples
.find(Json.obj("id" -> id))
.options(QueryOpts(page, pageSize))
.sort(Json.obj("civil.lastname" -> 1))
.cursor[People].collect[List](pageSize)


It returns a list of People with only civil.lastname filled.

I don't understand why, is there a trick  ?

Thanks in advance.

Cédric Chantepie

unread,
Oct 13, 2015, 4:30:43 PM10/13/15
to ReactiveMongo - http://reactivemongo.org
Hi, please first try the query by hand in the Mongo shell. What's the results by this way?

Nicolas Esteban

unread,
Oct 14, 2015, 2:25:55 AM10/14/15
to reacti...@googlegroups.com
Is there a way to get the query generated ? I tried before, by setting a lower level of log, but it was a nightmare to catch the query.

2015-10-13 22:30 GMT+02:00 Cédric Chantepie <chantep...@gmail.com>:
Hi, please first try the query by hand in the Mongo shell. What's the results by this way?

--
You received this message because you are subscribed to the Google Groups "ReactiveMongo - http://reactivemongo.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reactivemong...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cédric Chantepie

unread,
Oct 15, 2015, 12:16:06 AM10/15/15
to ReactiveMongo - http://reactivemongo.org
Just take the selector and sort documents (in JSON from your code), and call find on the right coll in your shell.
Reply all
Reply to author
Forward
0 new messages