Questions tagged [mongo-scala-driver]

57 questions
0
votes
1 answer

get values from BsonArray in scala

I'm interesting how can I transfor value from BsonArray to Seq[String] with mongodb scala driver. I'm getting value = Document((_id,BsonObjectId{value=5b112ca63b4dbed418a55eff}), (name,BsonString{value='test'}), (type,BsonString{value='test'}),…
Victor Garbuz
  • 75
  • 1
  • 8
0
votes
1 answer

Scala mongodb driver

Insertion is working fine. Problem is with find() For find(), val collection: MongoCollection[Machine] = mongoDB.getCollection(DbConstants.COLLECTION_NAME_MACHINE) collection.find().subscribe(new Observer[Machine] { override def…
Ambareesh B
  • 499
  • 1
  • 5
  • 14
0
votes
2 answers

How to parse an array of Object so it can fit in Bson document - Mongo Scala driver

I'm working with Scala, Play framework and Mongo scala driver to set a database up. I have json data coming and i want to set it in database, but I don't knowhow to format an array of objects so it can be passed. Here's the Json : { …
Azoulay Jason
  • 2,787
  • 5
  • 21
  • 46
0
votes
3 answers

Mongo Scala Driver - Can't insert in the database

I'm practicing on a project that needs a database connection, I'm using the Play Framework combine to Scala and MongoDB. I'm also using Mongo-scala-driver and following the documentation. I wrote the exact same code: println("start") val…
Azoulay Jason
  • 2,787
  • 5
  • 21
  • 46
0
votes
1 answer

Use Mongo Scala Driver Macros to read documents with additional nested fields

Is it possible to use the mongo-scala-driver macros to read documents from a mongo db which contain additional fields to the fields specified in the case classes? I expected the fields not specified in the case classes but in the document to be…
peterschrott
  • 570
  • 5
  • 25
0
votes
0 answers

mongo scala driver 2.0: cannot update with object?

I am refactoring an application to use the mongo-scala driver version 2.0 instead of reactivemongo. From working with reactivemongo and casbah I have come to expect to be able to update a document by providing a query to find the target document and…
KevinD
  • 31
  • 3
0
votes
1 answer

Subscribe to mongo query does not work

I use playframework with "org.mongodb.scala" %% "mongo-scala-driver" % "1.0.1" and have that code: val collection = Mongo.db.getCollection("regionAuth") def getRegions = { val find: Observable[Document] = collection.find() …
Artem
  • 505
  • 5
  • 22
0
votes
1 answer

Seq of observable to observable

I use mongo-scala-driver 1.0.1 that return Observable[Completed] after insertMany. I put many documents in cycle and I need to do some action after all of it already inserted. I can use observable.toFuture to get Seq[Future[Completed]] and then…
Artem
  • 505
  • 5
  • 22
0
votes
1 answer

runcommand is not a memeber of casbah mongocolection

db.foo.insert( { _id: 1 , desc: "the dog is running" } ) db.foo.insert( { _id: 2 , desc: "the cat is walking" } ) db.foo.ensureIndex( { "desc": "text" } ) db.foo.runCommand( "text", { search : "walk" } ) This is run in mongo How can i run in the…
-1
votes
2 answers

How to convert Scala Document to JSON in Scala

I want to convert variable message which is of type scala.Seq[Scala.Document] to JSON format in following code: path("getMessages"){ get { parameters('roomname.as[String]) { (roomname) => try { …
Ruchir Dixit
  • 105
  • 1
  • 9
-1
votes
1 answer

Mongo scala driver: Float value can't be added

I am experiecing strange problem with scala mongo driver. When I execute the following part: val doc:org.mongodb.scala.Document = org.mongodb.scala.Document( "junctionId" -> junctionId, "efficiencyArray" -> efficiencyMap.map(p=>…
nurgasemetey
  • 752
  • 3
  • 15
  • 39
-2
votes
1 answer

Exception in thread "main" org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.bson.BsonElement

I am getting below exception : Exception in thread "main" org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class org.bson.BsonElement. at org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46) …
1 2 3
4