Mongodb scala driver

Mongodb scala driver DEFAULT

MongoDB Scala Driver

Development of the MongoDB Scala Driver has moved to https://github.com/mongodb/mongo-java-driver, in the modules:

Documentation

Documentation for all the main versions is available on http://mongodb.github.io/mongo-scala-driver

Support / Feedback

For issues with, questions about, or feedback for the MongoDB Scala driver, please look into our support channels. Please do not email any of the Scala driver developers directly with issues or questions - you're more likely to get an answer on the MongoDB Community Forums.

At a minimum, please include in your description the exact version of the driver that you are using. If you are having connectivity issues, it's often also useful to paste in the line of code where you construct the MongoClient instance, along with the values of all parameters that you pass to the constructor. You should also check your application logs for any connectivity-related exceptions and post those as well.

Bugs / Feature Requests

Think you’ve found a bug? Want to see a new feature in the Scala driver? Please open a case in our issue management tool, JIRA:

Bug reports in JIRA for the driver and the Core Server (i.e. SERVER) project are public.

If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.

Versioning

Major increments (such as 1.x -> 2.x) will occur when break changes are being made to the public API. All methods and classes removed in a major release will have been deprecated in a prior release of the previous major release branch, and/or otherwise called out in the release notes.

Minor 1.x increments (such as 1.1, 1.2, etc) will occur when non-trivial new functionality is added or significant enhancements or bug fixes occur that may have behavioral changes that may affect some edge cases (such as dependence on behavior resulting from a bug). An example of an enhancement is a method or class added to support new functionality added to the MongoDB server. Minor releases will almost always be binary compatible with prior minor releases from the same major release branch, exept as noted below.

Patch 1.x.y increments (such as 1.0.0 -> 1.0.1, 1.1.1 -> 1.1.2, etc) will occur for bug fixes only and will always be binary compatible with prior patch releases of the same minor release branch.

Binaries

Binaries and dependency information for Maven, SBT, Ivy and others can be found at http://search.maven.org.

Build

To build the driver:

To publish the signed jars:

Maintainers

Additional contributors can be found here.

Supporters

JetBrains is supporting this open source project with:

Intellij IDEA

Sours: https://github.com/mongodb/mongo-scala-driver

On this page

This is the officially supported Scala driver for MongoDB.

It's a modern idiomatic Scala driver with asynchronous and non-blocking IO.

The recommended way to get started using the driver in your project is with a dependency management system like or . See the Installation Guide for more information.

To connect to a MongoDB Atlas cluster, use the Atlas connection string for your cluster:

See our guide on Connecting for more ways to connect.

You can use the Versioned API feature starting with MongoDB Server version 5.0 and Scala Driver version 4.3. When you use the Versioned API feature, you can update your driver or server without worrying about backward compatibility issues with any commands covered by the Versioned API. To use this feature, construct a MongoDB client instance, specifying a version of the Versioned API:

If you need to run a MongoDB server on your local machine for development purposes instead of using an Atlas cluster, you need to complete the following:

  1. Download the Community or Enterprise version of MongoDB Server.
  2. Install and configure MongoDB Server.
  3. Start the server.

Important

Always secure your MongoDB server from malicious attacks. See our Security Checklist for a list of security recommendations.

After you successfully start your MongoDB server, specify your connection string in your driver connection code.

If your MongoDB Server is running locally, you can use the connection string where is the port number you configured your server to listen for incoming connections.

If you need to specify a different hostname or IP address, see our Server Manual entry on Connection Strings.

To test whether you can connect to your server, replace the connection string in the Connect to MongoDB Atlas code example and run it.

Scala Driver Version

MongoDB 4.4

MongoDB 4.2

MongoDB 4.0

MongoDB 3.6

MongoDB 3.4

MongoDB 3.2

MongoDB 3.0

MongoDB 2.6

4.2

4.1

2.9

2.8

2.7

2.6

2.5

2.4

2.3

2.2

2.1

2.0

1.2

1.1

1.0

The driver does not support older versions of MongoDB.

Scala Driver Version

Scala 2.13

Scala 2.12

Scala 2.11

4.2

4.1

2.9

2.8

2.7

2.6

2.5

2.4

2.3

2.2

2.1

2.0

1.1

1.1

1.0

For more information on how to read the compatibility tables, see our guide on MongoDB Compatibility Tables.

Sours: https://docs.mongodb.com/drivers/scala/
  1. Minecraft hud mods
  2. Ttu ticket office
  3. Fun wall stickers
  4. 2019 kx450 hp
  5. Antique sash windows

MongoDB

The MongoDB connector allows you to read and save documents. You can query a stream of documents from or update documents in a collection with .

This connector is based on the MongoDB Java Driver, which is compatible with MongoDB versions 2.6 through 4.4.

Alternative connector

Another MongoDB connector is available - ReactiveMongo. It is a Scala driver that provides fully non-blocking and asynchronous I/O operations. Please read more about it in the ReactiveMongo documentation.

Artifacts

sbt
Maven
Gradle

The table below shows direct dependencies of this module and the second tab shows all libraries it depends on transitively.

Direct dependencies
OrganizationArtifactVersion
com.typesafe.akkaakka-stream_2.122.6.14
org.mongodb.scalamongo-scala-driver_2.124.1.1
org.scala-langscala-library2.12.11
Dependency tree
com.typesafe.akka akka-stream_2.12 2.6.14 Apache-2.0 com.typesafe.akka akka-actor_2.12 2.6.14 Apache-2.0 com.typesafe config 1.4.0 Apache-2.0 org.scala-lang.modules scala-java8-compat_2.12 0.8.0 BSD 3-clause org.scala-lang scala-library 2.12.11 Apache-2.0 org.scala-lang scala-library 2.12.11 Apache-2.0 com.typesafe.akka akka-protobuf-v3_2.12 2.6.14 Apache-2.0 com.typesafe ssl-config-core_2.12 0.4.2 Apache-2.0 com.typesafe config 1.4.0 Apache-2.0 org.scala-lang.modules scala-parser-combinators_2.12 1.1.2 Apache-2.0 org.scala-lang scala-library 2.12.11 Apache-2.0 org.scala-lang scala-library 2.12.11 Apache-2.0 org.reactivestreams reactive-streams 1.0.3 CC0 org.scala-lang scala-library 2.12.11 Apache-2.0 org.mongodb.scala mongo-scala-driver_2.12 4.1.1 The Apache License, Version 2.0 org.mongodb.scala mongo-scala-bson_2.12 4.1.1 The Apache License, Version 2.0 org.mongodb bson 4.1.1 The Apache License, Version 2.0 org.scala-lang scala-library 2.12.11 Apache-2.0 org.scala-lang scala-reflect 2.12.11 Apache-2.0 org.scala-lang scala-library 2.12.11 Apache-2.0 org.mongodb mongodb-driver-reactivestreams 4.1.1 The Apache License, Version 2.0 org.mongodb bson 4.1.1 The Apache License, Version 2.0 org.mongodb mongodb-driver-core 4.1.1 The Apache License, Version 2.0 org.mongodb bson 4.1.1 The Apache License, Version 2.0 org.reactivestreams reactive-streams 1.0.3 CC0 org.scala-lang scala-library 2.12.11 Apache-2.0 org.scala-lang scala-reflect 2.12.11 Apache-2.0 org.scala-lang scala-library 2.12.11 Apache-2.0 org.scala-lang scala-library 2.12.11 Apache-2.0

Initialization

In the code examples below we will be using Mongo’s support for automatic codec derivation for POJOs. For Scala we will be using a case class and a macro based codec derivation. For Java a codec for POJO is derived using reflection.

Scala
Java

For codec support, you first need to setup a CodecRegistry.

Scala
Java

Sources provided by this connector need a prepared collection to communicate with the MongoDB server. To get a reference to a collection, let’s initialize a MongoDB connection and access the database.

Scala
Java

We will also need an .

Scala
Java

Source

Let’s create a source from a Reactive Streams Publisher.

Scala
Java

And then run it.

Scala
Java

Here we used a basic sink to complete the stream by collecting all of the stream elements to a collection. The power of streams comes from building larger data pipelines which leverage backpressure to ensure efficient flow control. Feel free to edit the example code and build more advanced stream topologies.

Flow and Sink

Each of these sink factory methods have a corresponding factory in which will emit the written document or result of the operation downstream.

Insert

We can use a Source of documents to save them to a mongo collection using or .

Scala
Java

Insert Many

Insert many can be used if you have a collection of documents to insert at once.

Scala
Java

Update

We can update documents with a Source of which is a filter and an update definition. Use either or if the filter should target one or many documents.

Scala
Java

Delete

We can delete documents with a Source of filters. Use either or if the filter should target one or many documents.

Scala
Java
Sours: https://doc.akka.io/docs/alpakka/current/mongodb.html

In half an hour we were at the square. There were quite a lot of people, it was almost impossible to squeeze through to the end of the square, on which the stage was standing and. Some group was singing.

Scala driver mongodb

You are not do it. '' Lenochka, many people very often said this phrase to me, - Maria Alexandrovna smiled, - and they were all wrong. The Land Cruiser slowed down near the two-story mansion, the gates opened, and the car drove into the courtyard. Mom and Lena lived alone.

Carga de datos en MongoDB con Apache Spark

Oh, dear, she said, I'm just going to the bathroom. I'm not going to leave the house. She liked that her son wanted her to stay with him. Her husband never touched her in this way. She squeezed his hand and tried to free herself.

Similar news:

Neighboring dogs a mile away, sensing a stranger, raised a heart-rending bark. An old lady neighbor came out. Fortunately, she recognized Kolya, whom she had seen here several times and said that Ksyukhin's parents were not there and they had been like their relatives in the neighboring area for.



299 300 301 302 303