Asynchronous & Non-Blocking Scala Driver for MongoDB
Questions tagged [reactivemongo]
508 questions
0
votes
1 answer
ReactiveMongo: Manage Sequence field
I'm developing an app with Play Framework and ReactiveMongo.
I want to write CRUD operations for a model field with type of Seq[Entities]
Here is my model:
case class Person(_id: Option[BSONObjectID],
email: String,
…

Alex Fruzenshtein
- 2,846
- 6
- 32
- 53
0
votes
1 answer
Reactivemongo and Play, chaining queries
A bit new to Scala (latest), Reactivemongo (latest) and Play framework (2.3.x).
Validating sessions, and on success, loading the user object for it returning it as json. Problem is specific to mapping and futures I guess. The following code won't…

Wrench
- 4,070
- 4
- 34
- 46
0
votes
1 answer
Isn't there any other way to convert bson objects to case class and the vice-versa rather than the implicit conversion in scala?
I have went through some of the reactive mongo example and find the conversion of the model and the bson object as below.
case class Artist(
name: String,
slug: String,
artistId: Int,
albums: Vector[Album] = Vector(),
id: ObjectId =…

Pranjut
- 1,747
- 5
- 18
- 31
0
votes
1 answer
ReactiveMongo + Play Generic NullPointerException
I'm trying to incorporate a very simple Mongo model for my app, but my initial attempts have been futile. I am getting stuck with a NullPointerException and I've even tried wrapping my call with a Try and end up with a…

Benny
- 3,899
- 8
- 46
- 81
0
votes
1 answer
Reactivemongo nested JSON structure
I'm currently working on simple project in Play Framework 2.3.6 with reactivemongo "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23" and I have problem with nested structure.
My goal is to map such as JSON structure (to Scala…

Maciek Młynarski
- 3
- 1
- 1
0
votes
2 answers
Reactivemongo TTL collections
I know I can set TTL in MongoDB with
db.ttl_collection.ensureIndex( { "Date": 1 }, { expireAfterSeconds: 10 } )
and I know I can ensure index with Scala in Reactivemongo with
collection.indexesManager.ensure(index)
But how can I set TTL…

Krzysztof Wende
- 3,208
- 25
- 38
0
votes
1 answer
How to parse Cursor[JsObject] in scala reactive mongo
I have an API like this in play2.3 - reactive mongo-
def addEndUser = Action.async(parse.json) { request =>
val cursor: Cursor[JsObject] = collectionEndUser.find(Json.obj("mobileNumber" -> "9686563240","businessUserId" ->"1")).
…

user3777846
- 19
- 1
- 7
0
votes
1 answer
Finds all the documents were the an array field contains a document that match some conditions
I've a MongoDB collection that store all the user data.
A document of my collection has the following JSON form:
{
"_id" : ObjectId("542e67e07f724fc2af28ba75"),
"id" : "",
"email" : "luigi@gmail.com",
"tags" : [
{
…

alberto adami
- 729
- 1
- 6
- 25
0
votes
1 answer
Error on return a Future[Boolean] from a for in Scala
I'm writing a Play 2.3.2 application in Scala.
I use reactivemongo as driver for my MongoDB database.
I've a collection named "recommendation.tagsSimilarity", that contain the value of the similarity between my tags, where a tag is in the form…

alberto adami
- 729
- 1
- 6
- 25
0
votes
1 answer
Bad Symbolic reference to reactivemongo.api.collections.GenericHandlers encountered in class file 'JSONGenericHandlers.class'
I'm having my apis in play 2.3 with reactive mongo. Recently, i tried to cleaned the project and during the process, some things got updated. Later, when i tried to run or compile that, i'm getting these errors. Apart from clean, i didn't do…

user3777846
- 19
- 1
- 7
0
votes
1 answer
Find all documents where the array elements matches some conditions in reactivemongo
In my MongoDB database I've a collection named "recommendation.users" in which i store all the User data.
A document of my collection has the following form:
{
"_id" : ObjectId("542e67e07f724fc2af28ba75"),
"id" : "",
"email" :…

alberto adami
- 729
- 1
- 6
- 25
0
votes
2 answers
Error on an asynchronous play method with reactivemongo
i'm writing a Play 2.3.2 application using Reactivemongo with Scala.
In my db I store all the user data in a collection.
Now i'm writing an asynchronous method with the following behavior:
The method take the json value from the request.body…

alberto adami
- 729
- 1
- 6
- 25
0
votes
1 answer
Error on a count query on mongodb using reactivemongo
i'm writing a play 2.3.2 application.
In my application i use a MongoDB database.
I've a recommendation.tags and recommendation.request collections.
They has the following JSON format:
1) recommendation.tags:
{
"_id" :…

alberto adami
- 729
- 1
- 6
- 25
0
votes
2 answers
Understanding the Future[Option[T]] in reactiveMongo
i'm writing a play 2.3 application in Scala.
I use a mongoDB database and the ReactiveMongo driver.
The method that i call to read/write/update the dates in the db return a Future[Option[T]].
My question is this: if i had a method that first update…

alberto adami
- 729
- 1
- 6
- 25
0
votes
1 answer
Multiple LoginInfos with silhouette (play 2.3, reactivemongo)
Currently I build an application which uses silhouette for authentication. Every user should be able to authenticate via different providers.
Actually I cant figure out how to implement "silhouette" since the Identity trait only includes a single…

heiningair
- 441
- 1
- 6
- 23