Scala driver - findOne or limit?

Hi,

findOne - https://www.mongodb.com/docs/manual/reference/method/db.collection.findOne/

limit - https://www.mongodb.com/docs/manual/reference/method/cursor.limit/

Am I blind or does the Scala driver not support these? How is one supposed to do this with the Scala driver if not?

Hi @Kristoffer_Almas,

Looks like findOne in scala is :

collection.find().first().printHeadResult()

See the doc here.

And limit is just .limit(int) on a cursor which is called a FindObservable in Scala apparently:

See the doc here and search for “limit”.

Cheers,
Maxime.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.