├── .evergreen ├── config.yml ├── publish-snapshots.sh ├── run-coverage.sh ├── run-it-tests.sh ├── run-static-checks.sh └── run-unit-tests.sh ├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── README.md ├── bson └── src │ ├── main │ ├── scala-2.13+ │ │ └── org │ │ │ └── mongodb │ │ │ └── scala │ │ │ └── bson │ │ │ └── collection │ │ │ ├── immutable │ │ │ └── Document.scala │ │ │ └── mutable │ │ │ └── Document.scala │ ├── scala-2.13- │ │ └── org │ │ │ └── mongodb │ │ │ └── scala │ │ │ └── bson │ │ │ └── collection │ │ │ ├── immutable │ │ │ └── Document.scala │ │ │ └── mutable │ │ │ └── Document.scala │ └── scala │ │ └── org │ │ └── mongodb │ │ └── scala │ │ └── bson │ │ ├── BsonElement.scala │ │ ├── BsonMagnets.scala │ │ ├── BsonTransformer.scala │ │ ├── BsonValue.scala │ │ ├── DefaultHelper.scala │ │ ├── annotations │ │ └── BsonProperty.scala │ │ ├── codecs │ │ ├── DocumentCodecProvider.scala │ │ ├── ImmutableDocumentCodec.scala │ │ ├── IterableCodec.scala │ │ ├── IterableCodecProvider.scala │ │ ├── Macros.scala │ │ ├── MutableDocumentCodec.scala │ │ ├── macrocodecs │ │ │ ├── CaseClassCodec.scala │ │ │ ├── CaseClassProvider.scala │ │ │ └── MacroCodec.scala │ │ └── package.scala │ │ ├── collection │ │ ├── BaseDocument.scala │ │ └── package.scala │ │ ├── conversions │ │ └── package.scala │ │ └── package.scala │ └── test │ └── scala │ └── org │ └── mongodb │ └── scala │ └── bson │ ├── BsonTransformerSpec.scala │ ├── BsonValueSpec.scala │ ├── codecs │ ├── DocumentCodecProviderSpec.scala │ ├── ImmutableDocumentCodecSpec.scala │ ├── IterableCodecProviderSpec.scala │ ├── IterableCodecSpec.scala │ ├── MacrosSpec.scala │ └── MutableDocumentCodecSpec.scala │ └── collections │ ├── DocumentImplicitTypeConversion.scala │ ├── ImmutableDocumentSpec.scala │ └── MutableDocumentSpec.scala ├── build.sbt ├── docs ├── README.md ├── landing │ ├── README.md │ ├── config.toml │ ├── content │ │ └── .readme │ ├── data │ │ └── releases.toml │ ├── layouts │ │ ├── .readme │ │ ├── 404.html │ │ ├── index.html │ │ └── partials │ │ │ ├── assets │ │ │ ├── analytics.html │ │ │ ├── css.html │ │ │ └── javascripts.html │ │ │ ├── footer.html │ │ │ ├── header │ │ │ ├── main.html │ │ │ └── topRight.html │ │ │ ├── hero.html │ │ │ ├── introduction.html │ │ │ ├── meta.html │ │ │ ├── mongodbUniversity.html │ │ │ ├── quickStart.html │ │ │ └── releases.html │ └── static │ │ ├── .nojekyll │ │ ├── apple-touch-icon.png │ │ ├── favicon.ico │ │ ├── s │ │ ├── css │ │ │ └── frontpage.css │ │ ├── img │ │ │ ├── 24px-baseline-overlay.png │ │ │ ├── back-body.png │ │ │ ├── code-block-bg.png │ │ │ ├── code-block-bg@2x.png │ │ │ ├── favicon.png │ │ │ ├── gray.png │ │ │ ├── logo-mongodb-header.png │ │ │ ├── mongoScalaLogo.png │ │ │ ├── mongodb-university-logo.png │ │ │ ├── social-facebook.png │ │ │ ├── social-facebook@2x.png │ │ │ ├── social-gplus.png │ │ │ ├── social-gplus@2x.png │ │ │ ├── social-twitter.png │ │ │ ├── social-twitter@2x.png │ │ │ ├── social-youtube.png │ │ │ ├── social-youtube@2x.png │ │ │ ├── trans-user-back.png │ │ │ ├── trans-user-left.png │ │ │ └── trans-user-right.png │ │ ├── js │ │ │ ├── frontpage.js │ │ │ └── jquery.js │ │ └── lib │ │ │ ├── bootstrap-select │ │ │ ├── bootstrap-select.js │ │ │ ├── bootstrap-select.js.map │ │ │ ├── bootstrap-select.min.css │ │ │ └── bootstrap-select.min.js │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-toggle │ │ │ ├── bootstrap-toggle.min.css │ │ │ ├── bootstrap-toggle.min.js │ │ │ ├── bootstrap-toggle.min.js.map │ │ │ └── bootstrap2-toggle.min.js.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap.min.js │ │ │ ├── font-awesome │ │ │ ├── css │ │ │ │ ├── font-awesome.css │ │ │ │ └── font-awesome.min.css │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ └── fontawesome-webfont.woff │ │ │ ├── less │ │ │ │ ├── bordered-pulled.less │ │ │ │ ├── core.less │ │ │ │ ├── fixed-width.less │ │ │ │ ├── font-awesome.less │ │ │ │ ├── icons.less │ │ │ │ ├── larger.less │ │ │ │ ├── list.less │ │ │ │ ├── mixins.less │ │ │ │ ├── path.less │ │ │ │ ├── rotated-flipped.less │ │ │ │ ├── spinning.less │ │ │ │ ├── stacked.less │ │ │ │ └── variables.less │ │ │ └── scss │ │ │ │ ├── _bordered-pulled.scss │ │ │ │ ├── _core.scss │ │ │ │ ├── _fixed-width.scss │ │ │ │ ├── _icons.scss │ │ │ │ ├── _larger.scss │ │ │ │ ├── _list.scss │ │ │ │ ├── _mixins.scss │ │ │ │ ├── _path.scss │ │ │ │ ├── _rotated-flipped.scss │ │ │ │ ├── _spinning.scss │ │ │ │ ├── _stacked.scss │ │ │ │ ├── _variables.scss │ │ │ │ └── font-awesome.scss │ │ │ ├── highlight │ │ │ ├── CHANGES.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── highlight.pack.js │ │ │ └── styles │ │ │ │ ├── arta.css │ │ │ │ ├── ascetic.css │ │ │ │ ├── atelier-dune.dark.css │ │ │ │ ├── atelier-dune.light.css │ │ │ │ ├── atelier-forest.dark.css │ │ │ │ ├── atelier-forest.light.css │ │ │ │ ├── atelier-heath.dark.css │ │ │ │ ├── atelier-heath.light.css │ │ │ │ ├── atelier-lakeside.dark.css │ │ │ │ ├── atelier-lakeside.light.css │ │ │ │ ├── atelier-seaside.dark.css │ │ │ │ ├── atelier-seaside.light.css │ │ │ │ ├── brown_paper.css │ │ │ │ ├── brown_papersq.png │ │ │ │ ├── codepen-embed.css │ │ │ │ ├── color-brewer.css │ │ │ │ ├── dark.css │ │ │ │ ├── default.css │ │ │ │ ├── docco.css │ │ │ │ ├── far.css │ │ │ │ ├── foundation.css │ │ │ │ ├── github.css │ │ │ │ ├── googlecode.css │ │ │ │ ├── hybrid.css │ │ │ │ ├── idea.css │ │ │ │ ├── ir_black.css │ │ │ │ ├── kimbie.dark.css │ │ │ │ ├── kimbie.light.css │ │ │ │ ├── magula.css │ │ │ │ ├── mono-blue.css │ │ │ │ ├── monokai.css │ │ │ │ ├── monokai_sublime.css │ │ │ │ ├── obsidian.css │ │ │ │ ├── paraiso.dark.css │ │ │ │ ├── paraiso.light.css │ │ │ │ ├── pojoaque.css │ │ │ │ ├── pojoaque.jpg │ │ │ │ ├── railscasts.css │ │ │ │ ├── rainbow.css │ │ │ │ ├── school_book.css │ │ │ │ ├── school_book.png │ │ │ │ ├── solarized_dark.css │ │ │ │ ├── solarized_light.css │ │ │ │ ├── sunburst.css │ │ │ │ ├── tomorrow-night-blue.css │ │ │ │ ├── tomorrow-night-bright.css │ │ │ │ ├── tomorrow-night-eighties.css │ │ │ │ ├── tomorrow-night.css │ │ │ │ ├── tomorrow.css │ │ │ │ ├── vs.css │ │ │ │ ├── xcode.css │ │ │ │ └── zenburn.css │ │ │ ├── jquery.tipsy.js │ │ │ ├── tipsy.css │ │ │ ├── underscore-min.js │ │ │ └── zeroclipboard │ │ │ ├── .jshintrc │ │ │ ├── ZeroClipboard.Core.js │ │ │ ├── ZeroClipboard.Core.min.js │ │ │ ├── ZeroClipboard.Core.min.map │ │ │ ├── ZeroClipboard.js │ │ │ ├── ZeroClipboard.min.js │ │ │ ├── ZeroClipboard.min.map │ │ │ └── ZeroClipboard.swf │ │ └── versions.json └── reference │ ├── README.md │ ├── config.toml │ ├── content │ ├── bson │ │ ├── documents.md │ │ ├── extended-json.md │ │ ├── index.md │ │ └── macros.md │ ├── builders │ │ ├── aggregation.md │ │ ├── filters.md │ │ ├── index.md │ │ ├── indexes.md │ │ ├── projections.md │ │ ├── sorts.md │ │ └── updates.md │ ├── changelog.md │ ├── getting-started │ │ ├── index.md │ │ ├── installation-guide.md │ │ ├── quick-tour-admin.md │ │ ├── quick-tour-case-classes.md │ │ ├── quick-tour-primer.md │ │ └── quick-tour.md │ ├── index.md │ ├── integrations │ │ └── index.md │ ├── issues-help.md │ ├── reference │ │ ├── connecting │ │ │ ├── authenticating.md │ │ │ ├── connection-settings.md │ │ │ ├── index.md │ │ │ └── ssl.md │ │ ├── crud │ │ │ └── index.md │ │ ├── gridfs │ │ │ └── index.md │ │ ├── index.md │ │ ├── management │ │ │ ├── index.md │ │ │ ├── logging.md │ │ │ └── monitoring.md │ │ └── observables.md │ └── upgrade.md │ ├── data │ ├── .readme │ └── mongodb.toml │ ├── layouts │ ├── .readme │ ├── partials │ │ └── assets │ │ │ ├── cssExtras.html │ │ │ └── javascriptExtras.html │ └── shortcodes │ │ ├── apiref.html │ │ ├── coreapiref.html │ │ ├── coredocref.html │ │ ├── distroPicker.html │ │ ├── img.html │ │ └── install.html │ ├── static │ ├── .readme │ ├── css │ │ └── java.css │ ├── img │ │ ├── mongoReactiveLogo.png │ │ └── mongoRxLogo.png │ ├── js │ │ └── scala.js │ └── lib │ │ └── bootstrap-toggle │ │ ├── bootstrap-toggle.min.css │ │ ├── bootstrap-toggle.min.js │ │ ├── bootstrap-toggle.min.js.map │ │ └── bootstrap2-toggle.min.js.map │ └── themes │ └── mongodb │ ├── LICENSE.md │ ├── README.md │ ├── archetypes │ └── default.md │ ├── data │ └── mongodb.toml │ ├── layouts │ ├── _default │ │ ├── li.html │ │ ├── list.html │ │ └── single.html │ ├── index.html │ ├── partials │ │ ├── assets │ │ │ ├── analytics.html │ │ │ ├── css.html │ │ │ ├── cssExtras.html │ │ │ ├── javascriptExtras.html │ │ │ └── javascripts.html │ │ ├── footer.html │ │ ├── header.html │ │ ├── header │ │ │ ├── contentHeader.html │ │ │ ├── main.html │ │ │ ├── search.html │ │ │ └── topRight.html │ │ ├── menu.html │ │ ├── menu │ │ │ ├── currentItem.html │ │ │ ├── footer.html │ │ │ ├── item.html │ │ │ └── options.html │ │ ├── meta.html │ │ ├── rightColumn.html │ │ └── welcome.html │ └── shortcodes │ │ ├── docsref.html │ │ ├── note.html │ │ └── srcref.html │ ├── static │ ├── .nojekyll │ ├── apple-touch-icon.png │ ├── css │ │ ├── basic.css │ │ ├── bootstrap-custom.css │ │ ├── mongodb-docs.css │ │ ├── overrides.css │ │ └── reset.css │ ├── favicon.ico │ ├── img │ │ ├── 24px-baseline-overlay.png │ │ ├── back-body.png │ │ ├── code-block-bg.png │ │ ├── code-block-bg@2x.png │ │ ├── favicon.png │ │ ├── gray.png │ │ ├── logo-mongodb-header.png │ │ ├── social-facebook.png │ │ ├── social-facebook@2x.png │ │ ├── social-gplus.png │ │ ├── social-gplus@2x.png │ │ ├── social-twitter.png │ │ ├── social-twitter@2x.png │ │ ├── social-youtube.png │ │ ├── social-youtube@2x.png │ │ ├── trans-user-back.png │ │ ├── trans-user-left.png │ │ └── trans-user-right.png │ ├── js │ │ ├── doctools.js │ │ ├── jquery.js │ │ ├── navbar.js │ │ ├── scripts.js │ │ ├── searchtools.js │ │ └── underscore.js │ └── lib │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.js │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.js │ │ ├── font-awesome │ │ ├── css │ │ │ ├── font-awesome.css │ │ │ └── font-awesome.min.css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ ├── less │ │ │ ├── bordered-pulled.less │ │ │ ├── core.less │ │ │ ├── fixed-width.less │ │ │ ├── font-awesome.less │ │ │ ├── icons.less │ │ │ ├── larger.less │ │ │ ├── list.less │ │ │ ├── mixins.less │ │ │ ├── path.less │ │ │ ├── rotated-flipped.less │ │ │ ├── spinning.less │ │ │ ├── stacked.less │ │ │ └── variables.less │ │ └── scss │ │ │ ├── _bordered-pulled.scss │ │ │ ├── _core.scss │ │ │ ├── _fixed-width.scss │ │ │ ├── _icons.scss │ │ │ ├── _larger.scss │ │ │ ├── _list.scss │ │ │ ├── _mixins.scss │ │ │ ├── _path.scss │ │ │ ├── _rotated-flipped.scss │ │ │ ├── _spinning.scss │ │ │ ├── _stacked.scss │ │ │ ├── _variables.scss │ │ │ └── font-awesome.scss │ │ ├── highlight │ │ ├── CHANGES.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── highlight.pack.js │ │ └── styles │ │ │ ├── arta.css │ │ │ ├── ascetic.css │ │ │ ├── atelier-dune.dark.css │ │ │ ├── atelier-dune.light.css │ │ │ ├── atelier-forest.dark.css │ │ │ ├── atelier-forest.light.css │ │ │ ├── atelier-heath.dark.css │ │ │ ├── atelier-heath.light.css │ │ │ ├── atelier-lakeside.dark.css │ │ │ ├── atelier-lakeside.light.css │ │ │ ├── atelier-seaside.dark.css │ │ │ ├── atelier-seaside.light.css │ │ │ ├── brown_paper.css │ │ │ ├── brown_papersq.png │ │ │ ├── codepen-embed.css │ │ │ ├── color-brewer.css │ │ │ ├── dark.css │ │ │ ├── default.css │ │ │ ├── docco.css │ │ │ ├── far.css │ │ │ ├── foundation.css │ │ │ ├── github.css │ │ │ ├── googlecode.css │ │ │ ├── hybrid.css │ │ │ ├── idea.css │ │ │ ├── ir_black.css │ │ │ ├── kimbie.dark.css │ │ │ ├── kimbie.light.css │ │ │ ├── magula.css │ │ │ ├── mono-blue.css │ │ │ ├── monokai.css │ │ │ ├── monokai_sublime.css │ │ │ ├── obsidian.css │ │ │ ├── paraiso.dark.css │ │ │ ├── paraiso.light.css │ │ │ ├── pojoaque.css │ │ │ ├── pojoaque.jpg │ │ │ ├── railscasts.css │ │ │ ├── rainbow.css │ │ │ ├── school_book.css │ │ │ ├── school_book.png │ │ │ ├── solarized_dark.css │ │ │ ├── solarized_light.css │ │ │ ├── sunburst.css │ │ │ ├── tomorrow-night-blue.css │ │ │ ├── tomorrow-night-bright.css │ │ │ ├── tomorrow-night-eighties.css │ │ │ ├── tomorrow-night.css │ │ │ ├── tomorrow.css │ │ │ ├── vs.css │ │ │ ├── xcode.css │ │ │ └── zenburn.css │ │ ├── jquery.tipsy.js │ │ ├── tipsy.css │ │ └── underscore-min.js │ └── theme.toml ├── driver └── src │ ├── it │ ├── resources │ │ ├── crud │ │ │ ├── README.rst │ │ │ ├── db │ │ │ │ └── db-aggregate.json │ │ │ ├── read │ │ │ │ ├── aggregate-collation.json │ │ │ │ ├── aggregate-out.json │ │ │ │ ├── aggregate.json │ │ │ │ ├── count-collation.json │ │ │ │ ├── count-empty.json │ │ │ │ ├── count.json │ │ │ │ ├── distinct-collation.json │ │ │ │ ├── distinct.json │ │ │ │ ├── find-collation.json │ │ │ │ └── find.json │ │ │ └── write │ │ │ │ ├── bulkWrite-arrayFilters.json │ │ │ │ ├── bulkWrite-collation.json │ │ │ │ ├── bulkWrite.json │ │ │ │ ├── deleteMany-collation.json │ │ │ │ ├── deleteMany.json │ │ │ │ ├── deleteOne-collation.json │ │ │ │ ├── deleteOne.json │ │ │ │ ├── findOneAndDelete-collation.json │ │ │ │ ├── findOneAndDelete.json │ │ │ │ ├── findOneAndReplace-collation.json │ │ │ │ ├── findOneAndReplace-upsert.json │ │ │ │ ├── findOneAndReplace.json │ │ │ │ ├── findOneAndUpdate-arrayFilters.json │ │ │ │ ├── findOneAndUpdate-collation.json │ │ │ │ ├── findOneAndUpdate.json │ │ │ │ ├── insertMany.json │ │ │ │ ├── insertOne.json │ │ │ │ ├── replaceOne-collation.json │ │ │ │ ├── replaceOne.json │ │ │ │ ├── updateMany-arrayFilters.json │ │ │ │ ├── updateMany-collation.json │ │ │ │ ├── updateMany.json │ │ │ │ ├── updateOne-arrayFilters.json │ │ │ │ ├── updateOne-collation.json │ │ │ │ └── updateOne.json │ │ ├── gridfs-tests │ │ │ ├── delete.json │ │ │ ├── download.json │ │ │ ├── download_by_name.json │ │ │ └── upload.json │ │ └── logback-test.xml │ └── scala │ │ └── org │ │ └── mongodb │ │ └── scala │ │ ├── CrudSpec.scala │ │ ├── DocumentationChangeStreamExampleSpec.scala │ │ ├── DocumentationExampleSpec.scala │ │ ├── DocumentationTransactionsExampleSpec.scala │ │ ├── FuturesSpec.scala │ │ ├── MongoCollectionCaseClassSpec.scala │ │ ├── RequiresMongoDBISpec.scala │ │ ├── SmokeTestISpec.scala │ │ └── gridfs │ │ ├── GridFSObservableSpec.scala │ │ ├── GridFSSpec.scala │ │ └── helpers │ │ └── AsyncStreamHelperSpec.scala │ ├── main │ └── scala │ │ └── org │ │ └── mongodb │ │ └── scala │ │ ├── AggregateObservable.scala │ │ ├── AutoEncryptionSettings.scala │ │ ├── ChangeStreamObservable.scala │ │ ├── ClientEncryptionSettings.scala │ │ ├── ClientSessionImplicits.scala │ │ ├── ClientSessionOptions.scala │ │ ├── Completed.scala │ │ ├── DistinctObservable.scala │ │ ├── FindObservable.scala │ │ ├── Helpers.scala │ │ ├── ListCollectionsObservable.scala │ │ ├── ListDatabasesObservable.scala │ │ ├── ListIndexesObservable.scala │ │ ├── MapReduceObservable.scala │ │ ├── MongoClient.scala │ │ ├── MongoClientSettings.scala │ │ ├── MongoCollection.scala │ │ ├── MongoCompressor.scala │ │ ├── MongoCredential.scala │ │ ├── MongoDatabase.scala │ │ ├── MongoDriverInformation.scala │ │ ├── MongoNamespace.scala │ │ ├── Observable.scala │ │ ├── ObservableImplicits.scala │ │ ├── Observer.scala │ │ ├── ReadConcern.scala │ │ ├── ReadConcernLevel.scala │ │ ├── ReadPreference.scala │ │ ├── ServerAddress.scala │ │ ├── SingleObservable.scala │ │ ├── Subscription.scala │ │ ├── Tag.scala │ │ ├── TagSet.scala │ │ ├── TransactionOptions.scala │ │ ├── WriteConcern.scala │ │ ├── connection │ │ ├── AsynchronousSocketChannelStreamFactoryFactory.scala │ │ ├── ClusterSettings.scala │ │ ├── ConnectionPoolSettings.scala │ │ ├── NettyStreamFactoryFactory.scala │ │ ├── ServerSettings.scala │ │ ├── SocketSettings.scala │ │ ├── SslSettings.scala │ │ └── package.scala │ │ ├── gridfs │ │ ├── AsyncInputStream.scala │ │ ├── AsyncOutputStream.scala │ │ ├── GridFSBucket.scala │ │ ├── GridFSDownloadObservable.scala │ │ ├── GridFSDownloadStream.scala │ │ ├── GridFSFindObservable.scala │ │ ├── GridFSUploadObservable.scala │ │ ├── GridFSUploadStream.scala │ │ ├── helpers │ │ │ ├── AsyncStreamHelper.scala │ │ │ ├── AsynchronousChannelHelper.scala │ │ │ └── package.scala │ │ └── package.scala │ │ ├── internal │ │ ├── AndThenObservable.scala │ │ ├── ExecutionContextObservable.scala │ │ ├── FilterObservable.scala │ │ ├── FlatMapObservable.scala │ │ ├── FoldLeftObservable.scala │ │ ├── IterableObservable.scala │ │ ├── MapObservable.scala │ │ ├── ObservableHelper.scala │ │ ├── RecoverObservable.scala │ │ ├── RecoverWithObservable.scala │ │ ├── SingleItemObservable.scala │ │ ├── SubscriptionCheckingObserver.scala │ │ ├── WriteConcernImplicits.scala │ │ ├── ZipObservable.scala │ │ └── package.scala │ │ ├── model │ │ ├── Accumulators.scala │ │ ├── Aggregates.scala │ │ ├── BucketGranularity.scala │ │ ├── Collation.scala │ │ ├── CollationAlternate.scala │ │ ├── CollationCaseFirst.scala │ │ ├── CollationMaxVariable.scala │ │ ├── CollationStrength.scala │ │ ├── Filters.scala │ │ ├── Indexes.scala │ │ ├── MapReduceAction.scala │ │ ├── MergeOptions.scala │ │ ├── Projections.scala │ │ ├── ReturnDocument.scala │ │ ├── Sorts.scala │ │ ├── Updates.scala │ │ ├── ValidationAction.scala │ │ ├── ValidationLevel.scala │ │ ├── changestream │ │ │ ├── FullDocument.scala │ │ │ └── package.scala │ │ ├── geojson │ │ │ └── package.scala │ │ ├── package.scala │ │ └── vault │ │ │ └── package.scala │ │ ├── package.scala │ │ ├── result │ │ └── package.scala │ │ └── vault │ │ ├── ClientEncryption.scala │ │ ├── ClientEncryptions.scala │ │ └── package.scala │ └── test │ ├── resources │ └── logback-test.xml │ └── scala │ └── org │ └── mongodb │ └── scala │ ├── AggregateObservableSpec.scala │ ├── ApiAliasAndCompanionSpec.scala │ ├── ChangeStreamObservableSpec.scala │ ├── DistinctObservableSpec.scala │ ├── FindObservableSpec.scala │ ├── ListCollectionsObservableSpec.scala │ ├── ListDatabasesObservableSpec.scala │ ├── ListIndexesObservableSpec.scala │ ├── MapReduceObservableSpec.scala │ ├── MongoClientSettingsSpec.scala │ ├── MongoClientSpec.scala │ ├── MongoCollectionSpec.scala │ ├── MongoCredentialSpec.scala │ ├── MongoDatabaseSpec.scala │ ├── MongoDriverInformationSpec.scala │ ├── ReadConcernLevelSpec.scala │ ├── ReadConcernSpec.scala │ ├── ReadPreferenceSpec.scala │ ├── ScalaPackageSpec.scala │ ├── connection │ └── ConnectionSpec.scala │ ├── gridfs │ ├── GridFSBucketSpec.scala │ ├── GridFSDownloadStreamSpec.scala │ ├── GridFSFindObservableSpec.scala │ └── GridFSUploadStreamSpec.scala │ ├── internal │ ├── ObservableImplementationSpec.scala │ ├── OverridableObservableImplicitsSpec.scala │ ├── ScalaObservableSpec.scala │ ├── SingleObservableSpec.scala │ ├── TestObservable.scala │ └── TestObserver.scala │ └── model │ ├── AggregatesSpec.scala │ ├── BucketGranularitySpec.scala │ ├── CollationAlternateSpec.scala │ ├── CollationCaseFirstSpec.scala │ ├── CollationMaxVariableSpec.scala │ ├── CollationSpec.scala │ ├── CollationStrengthSpec.scala │ ├── FiltersSpec.scala │ ├── GeoJsonSpec.scala │ ├── IndexesSpec.scala │ ├── MapReduceActionSpec.scala │ ├── MergeOptionsSpec.scala │ ├── ModelSpec.scala │ ├── ProjectionsSpec.scala │ ├── ReturnDocumentSpec.scala │ ├── SortsSpec.scala │ ├── UpdatesSpec.scala │ ├── ValidationActionSpec.scala │ ├── ValidationLevelSpec.scala │ └── vault │ └── ClientEncryptionSpec.scala ├── examples ├── scripts │ ├── mongoexport.scala │ └── mongoimport.scala └── src │ └── test │ └── scala │ ├── reactivestreams │ ├── Implicits.scala │ ├── ReactiveStreamsExample.scala │ └── TestSubscriber.scala │ └── tour │ ├── GridFSTour.scala │ ├── Helpers.scala │ ├── QuickTour.scala │ ├── QuickTourAdmin.scala │ └── QuickTourCaseClass.scala ├── project ├── Dependencies.scala ├── MongoScalaBuild.scala ├── Publish.scala ├── Resolvers.scala ├── Versioning.scala ├── build.properties ├── plugins.sbt └── scalastyle-config.xml ├── rootdoc.txt └── sbt /.evergreen/publish-snapshots.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # DO NOT ECHO COMMANDS AS THEY CONTAIN SECRETS! 4 | set -o errexit # Exit the script with error if any of the commands fail 5 | 6 | # Used environment variables: 7 | # NEXUS_USERNAME 8 | # NEXUS_PASSWORD 9 | # SIGNING_KEY_ID 10 | # SIGNING_PASSWORD 11 | # RING_FILE_GPG_BASE64 12 | 13 | JAVA_HOME="/opt/java/jdk8" 14 | PUBLISH_PROPERTIES_FILE=${PROJECT_DIRECTORY}/.publishProperties 15 | SECRING_FILE=${PROJECT_DIRECTORY}/secring.gpg 16 | 17 | trap "rm ${PUBLISH_PROPERTIES_FILE}; rm ${SECRING_FILE}; exit" EXIT HUP 18 | 19 | echo ${RING_FILE_GPG_BASE64} | base64 -d > ${SECRING_FILE} 20 | 21 | echo nexusUsername=${NEXUS_USERNAME} > $PUBLISH_PROPERTIES_FILE 22 | echo nexusPassword=${NEXUS_PASSWORD} >> $PUBLISH_PROPERTIES_FILE 23 | echo signing.keyId=${SIGNING_KEY_ID} >> $PUBLISH_PROPERTIES_FILE 24 | echo signing.password=${SIGNING_PASSWORD} >> $PUBLISH_PROPERTIES_FILE 25 | echo signing.secretKeyRingFile=${SECRING_FILE} >> $PUBLISH_PROPERTIES_FILE 26 | 27 | ############################################ 28 | # Main Program # 29 | ############################################ 30 | 31 | echo "Publishing snapshots" 32 | 33 | ./sbt -java-home $JAVA_HOME version 34 | ./sbt -java-home $JAVA_HOME +clean +publishSnapshot -DpublishProperties=$PUBLISH_PROPERTIES_FILE 35 | -------------------------------------------------------------------------------- /.evergreen/run-coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o xtrace # Write all commands first to stderr 4 | set -o errexit # Exit the script with error if any of the commands fail 5 | 6 | # Supported/used environment variables: 7 | # MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info) 8 | 9 | MONGODB_URI=${MONGODB_URI:-} 10 | JAVA_HOME="/opt/java/jdk8" 11 | 12 | ############################################ 13 | # Main Program # 14 | ############################################ 15 | 16 | echo "Running coverage" 17 | 18 | ./sbt -java-home $JAVA_HOME version 19 | ./sbt -java-home $JAVA_HOME coverage unit:test -Dorg.mongodb.test.uri=${MONGODB_URI} 20 | ./sbt -java-home $JAVA_HOME coverage it:test -Dorg.mongodb.test.uri=${MONGODB_URI} 21 | ./sbt -java-home $JAVA_HOME coverageAggregate 22 | ./sbt -java-home $JAVA_HOME coverageReport 23 | -------------------------------------------------------------------------------- /.evergreen/run-it-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o xtrace # Write all commands first to stderr 4 | set -o errexit # Exit the script with error if any of the commands fail 5 | 6 | # Supported/used environment variables: 7 | # MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info) 8 | # STREAM_TYPE The async stream type to test with 9 | # TOPOLOGY Allows you to modify variables and the MONGODB_URI based on test topology 10 | # Supported values: "server", "replica_set", "sharded_cluster" 11 | # SCALA_VERSION Set the version of Scala to be used. 12 | 13 | 14 | MONGODB_URI=${MONGODB_URI:-} 15 | STREAM_TYPE=${STREAM_TYPE:-} 16 | TOPOLOGY=${TOPOLOGY:-server} 17 | JAVA_HOME="/opt/java/jdk8" 18 | 19 | ############################################ 20 | # Main Program # 21 | ############################################ 22 | 23 | # Provision the correct connection string 24 | if [ "$TOPOLOGY" == "sharded_cluster" ]; then 25 | export MONGODB_URI="mongodb://localhost:27017" 26 | fi 27 | if [ "$TOPOLOGY" == "replica_set" ]; then 28 | export MONGODB_URI="${MONGODB_URI}&streamType=${STREAM_TYPE}" 29 | else 30 | export MONGODB_URI="${MONGODB_URI}/streamType=${STREAM_TYPE}" 31 | fi 32 | 33 | echo "Running Integration tests for Scala $SCALA_VERSION, $TOPOLOGY and connecting to $MONGODB_URI" 34 | 35 | ./sbt -java-home $JAVA_HOME version 36 | ./sbt -java-home $JAVA_HOME ++${SCALA_VERSION} it:test -Dorg.mongodb.test.uri=${MONGODB_URI} 37 | -------------------------------------------------------------------------------- /.evergreen/run-static-checks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o xtrace # Write all commands first to stderr 4 | set -o errexit # Exit the script with error if any of the commands fail 5 | 6 | JAVA_HOME="/opt/java/jdk8" 7 | 8 | ############################################ 9 | # Main Program # 10 | ############################################ 11 | 12 | echo "Running static checks" 13 | 14 | ./sbt -java-home $JAVA_HOME version 15 | ./sbt -java-home $JAVA_HOME clean compile doc scalastyle 16 | -------------------------------------------------------------------------------- /.evergreen/run-unit-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o xtrace # Write all commands first to stderr 4 | set -o errexit # Exit the script with error if any of the commands fail 5 | 6 | # Supported/used environment variables: 7 | # SCALA_VERSION Sets the Scala version 8 | 9 | JAVA_HOME="/opt/java/jdk8" 10 | 11 | ############################################ 12 | # Main Program # 13 | ############################################ 14 | 15 | echo "Running unit tests for Scala $SCALA_VERSION" 16 | 17 | ./sbt -java-home $JAVA_HOME version 18 | ./sbt -java-home $JAVA_HOME ++${SCALA_VERSION} unit:test 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .#* 3 | .git 4 | *# 5 | .java-version 6 | 7 | # os x stuff 8 | *Thumbs.db* 9 | *.DS_Store 10 | 11 | # Build artifacts 12 | target 13 | 14 | # Eclipse files 15 | .classpath 16 | .project 17 | .settings 18 | 19 | # Intellij IDEA files 20 | *.ipr 21 | *.iws 22 | *.iml 23 | *.idea 24 | workspace.xml 25 | atlassian-ide-plugin.xml 26 | *.sc 27 | 28 | # doc settings 29 | docs/reference/public 30 | docs/landing/public 31 | docs/hugo* 32 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | sudo: true 3 | language: scala 4 | scala: 5 | - 2.11.12 6 | - 2.12.8 7 | - 2.13.1 8 | 9 | jdk: 10 | - oraclejdk8 11 | 12 | # Branches to test 13 | branches: 14 | only: 15 | - master 16 | 17 | notifications: 18 | email: 19 | recipients: 20 | - ross@mongodb.com 21 | on_success: change 22 | on_failure: always 23 | 24 | matrix: 25 | fast_finish: true 26 | 27 | env: 28 | matrix: 29 | - MONGODB=4.0.5 30 | 31 | 32 | install: 33 | - wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB}.tgz 34 | - tar xzf mongodb-linux-x86_64-${MONGODB}.tgz 35 | - ${PWD}/mongodb-linux-x86_64-${MONGODB}/bin/mongod --version 36 | 37 | before_script: 38 | - mkdir ${PWD}/mongodb-linux-x86_64-${MONGODB}/data 39 | - ${PWD}/mongodb-linux-x86_64-${MONGODB}/bin/mongod --dbpath ${PWD}/mongodb-linux-x86_64-${MONGODB}/data --logpath ${PWD}/mongodb-linux-x86_64-${MONGODB}/mongodb.log --fork 40 | - echo $TRAVIS_SCALA_VERSION 41 | 42 | script: 43 | - ./sbt ++$TRAVIS_SCALA_VERSION check 44 | 45 | after_script: 46 | - pkill mongod 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Notice 2 | 3 | This repository has been archived, and code for the Scala driver has been moved to the [MongoDB JVM Drivers repository](https://github.com/mongodb/mongo-java-driver). 4 | 5 | To access the MongoDB Scala Driver documentation, please refer to our official documentation [here](https://www.mongodb.com/docs/languages/scala/scala-driver/current/). 6 | 7 | For the most recent release of the MongoDB Scala driver, please refer to [Maven](https://mvnrepository.com/artifact/org.mongodb.scala/mongo-scala-driver). 8 | -------------------------------------------------------------------------------- /bson/src/main/scala/org/mongodb/scala/bson/BsonElement.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson 18 | 19 | /** 20 | * A companion helper for a `BsonElement` - the mapping from a name to a BsonValue. 21 | * 22 | * Used by the [[BsonMagnets]] and polices valid key/value pairs types for [[Document]]. 23 | * 24 | * @since 1.0 25 | */ 26 | object BsonElement { 27 | def apply(key: String, value: BsonValue): BsonElement = new BsonElement(key, value) 28 | } 29 | -------------------------------------------------------------------------------- /bson/src/main/scala/org/mongodb/scala/bson/annotations/BsonProperty.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson.annotations 18 | 19 | import scala.annotation.StaticAnnotation 20 | 21 | /** 22 | * Annotation to change the stored key of a property 23 | * 24 | * @param key the key for the stored property 25 | */ 26 | case class BsonProperty(key: String) extends StaticAnnotation 27 | -------------------------------------------------------------------------------- /bson/src/main/scala/org/mongodb/scala/bson/codecs/DocumentCodecProvider.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson.codecs 18 | 19 | import org.bson.codecs.Codec 20 | import org.bson.codecs.configuration.{ CodecProvider, CodecRegistry } 21 | import org.mongodb.scala.bson.collection.{ immutable, mutable } 22 | 23 | /** 24 | * A [[http://api.mongodb.org/java/current/org/bson/codecs/configuration/CodecProvider.html CodecProvider]] for the Document 25 | * class and all the default Codec implementations on which it depends. 26 | */ 27 | case class DocumentCodecProvider() extends CodecProvider { 28 | 29 | val IMMUTABLE: Class[immutable.Document] = classOf[immutable.Document] 30 | val MUTABLE: Class[mutable.Document] = classOf[mutable.Document] 31 | 32 | // scalastyle:off null 33 | @SuppressWarnings(Array("unchecked")) 34 | def get[T](clazz: Class[T], registry: CodecRegistry): Codec[T] = { 35 | clazz match { 36 | case IMMUTABLE => ImmutableDocumentCodec(registry).asInstanceOf[Codec[T]] 37 | case MUTABLE => MutableDocumentCodec(registry).asInstanceOf[Codec[T]] 38 | case _ => null 39 | } 40 | } 41 | // scalastyle:on null 42 | } 43 | -------------------------------------------------------------------------------- /bson/src/main/scala/org/mongodb/scala/bson/codecs/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson 18 | 19 | import org.bson.codecs.configuration.CodecRegistries.{ fromRegistries, fromProviders } 20 | import org.bson.codecs.configuration.CodecRegistry 21 | import com.mongodb.async.client.MongoClients 22 | 23 | package object codecs { 24 | 25 | @deprecated("Please use org.mongodb.scala.MongoClient.DEFAULT_CODEC_REGISTRY instead", "2.9.0") 26 | val DEFAULT_CODEC_REGISTRY: CodecRegistry = fromRegistries( 27 | fromProviders(DocumentCodecProvider(), IterableCodecProvider()), 28 | MongoClients.getDefaultCodecRegistry 29 | ) 30 | 31 | /** 32 | * Type alias to the `BsonTypeClassMap` 33 | */ 34 | type BsonTypeClassMap = org.bson.codecs.BsonTypeClassMap 35 | 36 | /** 37 | * Companion to return the default `BsonTypeClassMap` 38 | */ 39 | object BsonTypeClassMap { 40 | def apply(): BsonTypeClassMap = new BsonTypeClassMap() 41 | } 42 | 43 | /** 44 | * Type alias to the `BsonTypeCodecMap` 45 | */ 46 | type BsonTypeCodecMap = org.bson.codecs.BsonTypeCodecMap 47 | 48 | } 49 | -------------------------------------------------------------------------------- /bson/src/main/scala/org/mongodb/scala/bson/collection/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson 18 | 19 | /** 20 | * The collection package. 21 | */ 22 | package object collection { 23 | 24 | /** 25 | * An immutable Document implementation. 26 | * 27 | * A strictly typed `Map[String, BsonValue]` like structure that traverses the elements in insertion order. Unlike native scala maps there 28 | * is no variance in the value type and it always has to be a `BsonValue`. 29 | */ 30 | type Document = immutable.Document 31 | 32 | /** 33 | * An immutable Document implementation. 34 | * 35 | * A strictly typed `Map[String, BsonValue]` like structure that traverses the elements in insertion order. Unlike native scala maps there 36 | * is no variance in the value type and it always has to be a `BsonValue`. 37 | */ 38 | val Document = immutable.Document 39 | 40 | } 41 | -------------------------------------------------------------------------------- /bson/src/main/scala/org/mongodb/scala/bson/conversions/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson 18 | 19 | /** 20 | * The conversions package. 21 | */ 22 | package object conversions { 23 | /** 24 | * Type alias to the Bson interface - an interface for types that are able to render themselves into a `BsonDocument`. 25 | */ 26 | type Bson = org.bson.conversions.Bson 27 | } 28 | -------------------------------------------------------------------------------- /bson/src/test/scala/org/mongodb/scala/bson/codecs/DocumentCodecProviderSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson.codecs 18 | 19 | import org.bson.codecs.configuration.CodecRegistries.fromProviders 20 | 21 | import org.mongodb.scala.bson.collection.{ Document, immutable, mutable } 22 | import org.scalatest.{ FlatSpec, Matchers } 23 | 24 | class DocumentCodecProviderSpec extends FlatSpec with Matchers { 25 | 26 | "DocumentCodecProvider" should "get the correct codec" in { 27 | 28 | val provider = DocumentCodecProvider() 29 | val registry = fromProviders(provider) 30 | 31 | provider.get[Document](classOf[Document], registry) shouldBe a[ImmutableDocumentCodec] 32 | provider.get[immutable.Document](classOf[immutable.Document], registry) shouldBe a[ImmutableDocumentCodec] 33 | provider.get[mutable.Document](classOf[mutable.Document], registry) shouldBe a[MutableDocumentCodec] 34 | Option(provider.get[String](classOf[String], registry)) shouldBe None 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bson/src/test/scala/org/mongodb/scala/bson/codecs/IterableCodecProviderSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson.codecs 18 | 19 | import org.bson.codecs.configuration.CodecRegistries.fromProviders 20 | 21 | import org.scalatest.{ FlatSpec, Matchers } 22 | 23 | class IterableCodecProviderSpec extends FlatSpec with Matchers { 24 | 25 | "IterableCodecProvider" should "get the correct codec" in { 26 | 27 | val provider = IterableCodecProvider() 28 | val registry = fromProviders(provider) 29 | 30 | provider.get[Iterable[Any]](classOf[Iterable[Any]], registry) shouldBe a[IterableCodec] 31 | provider.get[List[String]](classOf[List[String]], registry) shouldBe a[IterableCodec] 32 | provider.get[Seq[Integer]](classOf[Seq[Integer]], registry) shouldBe a[IterableCodec] 33 | provider.get[Map[String, Integer]](classOf[Map[String, Integer]], registry) shouldBe a[IterableCodec] 34 | Option(provider.get[String](classOf[String], registry)) shouldBe None 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /build.sbt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/build.sbt -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # MongoDB Scala Driver Documentation 2 | 3 | 1. landing - the front page of all the MongoDB Scala Driver docs 4 | 2. reference - the reference site for the current version of the driver 5 | -------------------------------------------------------------------------------- /docs/landing/README.md: -------------------------------------------------------------------------------- 1 | # MongoDB Scala Driver Front page 2 | 3 | The static front page site for the Scala documentation portal. 4 | 5 | ## Requirements 6 | Hugo version 0.13 [download here](https://github.com/spf13/hugo/releases/tag/v0.13) 7 |
8 | Check out the hugo [quickstart guide](http://gohugo.io/overview/quickstart/). 9 | 10 | ## Running the server 11 | To run the server call the hugo command: 12 | 13 | hugo server --baseUrl=http://localhost/ --buildDrafts --watch 14 | 15 | | Options explained || 16 | | --------------------------- |--------------------------------------------------------------------------| 17 | | server | Hugo runs its own webserver to render the files | 18 | | --baseUrl=http://localhost/ | Normally the base url will be /mongo-scala-driver for gh-pages | 19 | | --buildDrafts | Include draft posts in the output - these won't be published to gh-pages | 20 | | -- watch | Automatically reloads on file change | 21 | 22 | 23 | All generated content will appear in the `./public` folder, so you can also check the filesystem and browse it locally.
24 | For more hugo server options run: `hugo --help` 25 | 26 | ### Data 27 | 28 | All dynamic / changing data lives in `./data/mongodb.toml` 29 | 30 | Existing versions live in `static/versions.json` 31 | -------------------------------------------------------------------------------- /docs/landing/config.toml: -------------------------------------------------------------------------------- 1 | baseurl = "/mongo-scala-driver/" 2 | languageCode = "en-us" 3 | title = "MongoDB Scala Driver" 4 | canonifyurls = false 5 | 6 | githubRepo = "mongo-scala-driver" 7 | -------------------------------------------------------------------------------- /docs/landing/content/.readme: -------------------------------------------------------------------------------- 1 | content dir 2 | -------------------------------------------------------------------------------- /docs/landing/data/releases.toml: -------------------------------------------------------------------------------- 1 | driverName = "mongo-scala-driver" 2 | githubRepo = "mongo-scala-driver" 3 | current = "2.9.0" 4 | 5 | [[versions]] 6 | version = "2.9.0" 7 | status = "current" 8 | docs = "./2.9" 9 | api = "./2.9/scaladoc" 10 | 11 | [[versions]] 12 | version = "2.8.0" 13 | docs = "./2.8" 14 | api = "./2.8/scaladoc" 15 | 16 | [[versions]] 17 | version = "2.7.0" 18 | docs = "./2.7" 19 | api = "./2.7/scaladoc" 20 | 21 | [[versions]] 22 | version = "2.6.0" 23 | docs = "./2.6" 24 | api = "./2.6/scaladoc" 25 | 26 | [[versions]] 27 | version = "2.5.0" 28 | docs = "./2.5" 29 | api = "./2.5/scaladoc" 30 | 31 | [[versions]] 32 | version = "2.4.2" 33 | docs = "./2.4" 34 | api = "./2.4/scaladoc" 35 | 36 | [[versions]] 37 | version = "2.3.0" 38 | docs = "./2.3" 39 | api = "./2.3/scaladoc" 40 | 41 | [[versions]] 42 | version = "2.2.1" 43 | docs = "./2.2" 44 | api = "./2.2/scaladoc" 45 | 46 | [[versions]] 47 | version = "2.1.0" 48 | docs = "./2.1" 49 | api = "./2.1/scaladoc" 50 | 51 | [[versions]] 52 | version = "2.0.0" 53 | docs = "./2.0" 54 | api = "./2.0/scaladoc" 55 | 56 | [[versions]] 57 | version = "1.2.1" 58 | docs = "./1.2" 59 | api = "./1.2/scaladoc" 60 | 61 | [[versions]] 62 | version = "1.1.1" 63 | docs = "./1.1" 64 | api = "./1.1/scaladoc" 65 | 66 | [[versions]] 67 | version = "1.0.1" 68 | docs = "./1.0" 69 | api = "./1.0/scaladoc" 70 | -------------------------------------------------------------------------------- /docs/landing/layouts/.readme: -------------------------------------------------------------------------------- 1 | custom layouts here 2 | -------------------------------------------------------------------------------- /docs/landing/layouts/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ partial "meta.html"}} 5 | 6 | 7 | {{.Title}} 8 | 9 | {{ partial "assets/css.html" . }} 10 | 11 | 12 | 13 | 14 | {{ partial "header/main.html" . }} 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |

404: Page not found

23 |
24 | 25 |
26 |
27 |
28 | 29 | 30 | 31 |
32 |
33 |
34 | {{ partial "footer.html" .}} 35 |
36 |
37 |
38 | 39 | 40 | 41 | 42 | {{ partial "assets/javascripts.html" . }} 43 | {{ partial "assets/analytics.html" . }} 44 | 45 | 46 | -------------------------------------------------------------------------------- /docs/landing/layouts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ partial "meta.html"}} 5 | 6 | 7 | {{.Title}} 8 | 9 | {{ partial "assets/css.html" . }} 10 | 11 | 12 | 13 | 14 | {{ partial "header/main.html" . }} 15 | 16 | 17 | {{ partial "hero.html" . }} 18 | 19 | 20 |
21 |
22 |
23 | {{ partial "introduction.html" . }} 24 | 25 | {{ partial "quickStart.html" . }} 26 |
27 |
28 | {{ partial "releases.html" . }} 29 | {{ partial "mongodbUniversity.html" . }} 30 |
31 |
32 |
33 | 34 | 35 | 36 |
37 |
38 |
39 | {{ partial "footer.html" .}} 40 |
41 |
42 |
43 | 44 | 45 | 46 | 47 | {{ partial "assets/javascripts.html" . }} 48 | {{ partial "assets/analytics.html" . }} 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/assets/analytics.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | 12 | 23 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/assets/css.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/assets/javascripts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/header/main.html: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/header/topRight.html: -------------------------------------------------------------------------------- 1 |
2 | 9 |
10 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/hero.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

MongoDB Scala Driver

7 |

8 | The next generation Scala driver for MongoDB 9 |

10 |

11 | {{ range where $.Site.Data.releases.versions "version" $.Site.Data.releases.current }}{{ $.Scratch.Set "qs.currentReleasedVersion" . }}{{end }} 12 | {{$currentReleasedVersion := $.Scratch.Get "qs.currentReleasedVersion"}} 13 | Latest documentation 14 |

15 | 16 |
17 | 18 |
19 |
20 |
21 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/introduction.html: -------------------------------------------------------------------------------- 1 |
2 |
Project documentation moved for latest version
3 | The latest scala driver documentation has been merged with the Java Driver.
4 | The latest documentation is available from: http://mongodb.github.io/mongo-java-driver/. 5 |
6 | 7 |

Introduction

8 | 9 |

10 | The official MongoDB Scala Driver, providing asynchronous event-based observable sequences for MongoDB. 11 |

12 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/meta.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/mongodbUniversity.html: -------------------------------------------------------------------------------- 1 |
2 |

MongoDB University

3 | 4 |

M101J: MongoDB for Java Developers

5 |

Learn everything you need to know to get started building a MongoDB-based app. From basic installation, JSON, schema design, querying, insertion of data, indexing and working with the Java driver. 6 |

7 |

8 | Learn More 9 |

10 |
11 | -------------------------------------------------------------------------------- /docs/landing/layouts/partials/releases.html: -------------------------------------------------------------------------------- 1 | {{ with $.Site.Data.releases.versions }} 2 |
3 |

Releases

4 | 5 | 6 | 7 | {{ range . }} 8 | 9 | 10 | 11 | 12 | {{ end }} 13 | 14 |
ReleaseDocumentation
{{.version}}Reference | API
15 |
16 | {{ end }} 17 | -------------------------------------------------------------------------------- /docs/landing/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/.nojekyll -------------------------------------------------------------------------------- /docs/landing/static/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/landing/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/favicon.ico -------------------------------------------------------------------------------- /docs/landing/static/s/img/24px-baseline-overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/24px-baseline-overlay.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/back-body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/back-body.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/code-block-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/code-block-bg.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/code-block-bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/code-block-bg@2x.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/favicon.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/gray.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/logo-mongodb-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/logo-mongodb-header.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/mongoScalaLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/mongoScalaLogo.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/mongodb-university-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/mongodb-university-logo.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/social-facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/social-facebook.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/social-facebook@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/social-facebook@2x.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/social-gplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/social-gplus.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/social-gplus@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/social-gplus@2x.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/social-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/social-twitter.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/social-twitter@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/social-twitter@2x.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/social-youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/social-youtube.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/social-youtube@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/social-youtube@2x.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/trans-user-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/trans-user-back.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/trans-user-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/trans-user-left.png -------------------------------------------------------------------------------- /docs/landing/static/s/img/trans-user-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/img/trans-user-right.png -------------------------------------------------------------------------------- /docs/landing/static/s/lib/bootstrap-toggle/bootstrap-toggle.min.css: -------------------------------------------------------------------------------- 1 | /*! ======================================================================== 2 | * Bootstrap Toggle: bootstrap-toggle.css v2.2.0 3 | * http://www.bootstraptoggle.com 4 | * ======================================================================== 5 | * Copyright 2014 Min Hur, The New York Times Company 6 | * Licensed under MIT 7 | * ======================================================================== */ 8 | .checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px} 9 | .toggle{position:relative;overflow:hidden} 10 | .toggle input[type=checkbox]{display:none} 11 | .toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} 12 | .toggle.off .toggle-group{left:-100%} 13 | .toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} 14 | .toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} 15 | .toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} 16 | .toggle.btn{min-width:59px;min-height:34px} 17 | .toggle-on.btn{padding-right:24px} 18 | .toggle-off.btn{padding-left:24px} 19 | .toggle.btn-lg{min-width:79px;min-height:45px} 20 | .toggle-on.btn-lg{padding-right:31px} 21 | .toggle-off.btn-lg{padding-left:31px} 22 | .toggle-handle.btn-lg{width:40px} 23 | .toggle.btn-sm{min-width:50px;min-height:30px} 24 | .toggle-on.btn-sm{padding-right:20px} 25 | .toggle-off.btn-sm{padding-left:20px} 26 | .toggle.btn-xs{min-width:35px;min-height:22px} 27 | .toggle-on.btn-xs{padding-right:12px} 28 | .toggle-off.btn-xs{padding-left:12px} -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/lib/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/lib/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/lib/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/lib/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .@{fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font-family: FontAwesome; 7 | font-style: normal; 8 | font-weight: normal; 9 | line-height: 1; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "spinning"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: -@fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon-rotate(@degrees, @rotation) { 5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 6 | -webkit-transform: rotate(@degrees); 7 | -moz-transform: rotate(@degrees); 8 | -ms-transform: rotate(@degrees); 9 | -o-transform: rotate(@degrees); 10 | transform: rotate(@degrees); 11 | } 12 | 13 | .fa-icon-flip(@horiz, @vert, @rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 15 | -webkit-transform: scale(@horiz, @vert); 16 | -moz-transform: scale(@horiz, @vert); 17 | -ms-transform: scale(@horiz, @vert); 18 | -o-transform: scale(@horiz, @vert); 19 | transform: scale(@horiz, @vert); 20 | } 21 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 9 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 10 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 11 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/spinning.less: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: spin 2s infinite linear; 6 | -moz-animation: spin 2s infinite linear; 7 | -o-animation: spin 2s infinite linear; 8 | animation: spin 2s infinite linear; 9 | } 10 | 11 | @-moz-keyframes spin { 12 | 0% { -moz-transform: rotate(0deg); } 13 | 100% { -moz-transform: rotate(359deg); } 14 | } 15 | @-webkit-keyframes spin { 16 | 0% { -webkit-transform: rotate(0deg); } 17 | 100% { -webkit-transform: rotate(359deg); } 18 | } 19 | @-o-keyframes spin { 20 | 0% { -o-transform: rotate(0deg); } 21 | 100% { -o-transform: rotate(359deg); } 22 | } 23 | @-ms-keyframes spin { 24 | 0% { -ms-transform: rotate(0deg); } 25 | 100% { -ms-transform: rotate(359deg); } 26 | } 27 | @keyframes spin { 28 | 0% { transform: rotate(0deg); } 29 | 100% { transform: rotate(359deg); } 30 | } 31 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font-family: FontAwesome; 7 | font-style: normal; 8 | font-weight: normal; 9 | line-height: 1; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon-rotate($degrees, $rotation) { 5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation); 6 | -webkit-transform: rotate($degrees); 7 | -moz-transform: rotate($degrees); 8 | -ms-transform: rotate($degrees); 9 | -o-transform: rotate($degrees); 10 | transform: rotate($degrees); 11 | } 12 | 13 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation); 15 | -webkit-transform: scale($horiz, $vert); 16 | -moz-transform: scale($horiz, $vert); 17 | -ms-transform: scale($horiz, $vert); 18 | -o-transform: scale($horiz, $vert); 19 | transform: scale($horiz, $vert); 20 | } 21 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 9 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 10 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 11 | //src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_spinning.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: spin 2s infinite linear; 6 | -moz-animation: spin 2s infinite linear; 7 | -o-animation: spin 2s infinite linear; 8 | animation: spin 2s infinite linear; 9 | } 10 | 11 | @-moz-keyframes spin { 12 | 0% { -moz-transform: rotate(0deg); } 13 | 100% { -moz-transform: rotate(359deg); } 14 | } 15 | @-webkit-keyframes spin { 16 | 0% { -webkit-transform: rotate(0deg); } 17 | 100% { -webkit-transform: rotate(359deg); } 18 | } 19 | @-o-keyframes spin { 20 | 0% { -o-transform: rotate(0deg); } 21 | 100% { -o-transform: rotate(359deg); } 22 | } 23 | @-ms-keyframes spin { 24 | 0% { -ms-transform: rotate(0deg); } 25 | 100% { -ms-transform: rotate(359deg); } 26 | } 27 | @keyframes spin { 28 | 0% { transform: rotate(0deg); } 29 | 100% { transform: rotate(359deg); } 30 | } 31 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "spinning"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/highlight/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Ivan Sagalaev 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of highlight.js nor the names of its contributors 12 | may be used to endorse or promote products derived from this software 13 | without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/highlight/styles/ascetic.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: white; 12 | color: black; 13 | -webkit-text-size-adjust: none; 14 | } 15 | 16 | .hljs-string, 17 | .hljs-tag .hljs-value, 18 | .hljs-filter .hljs-argument, 19 | .hljs-addition, 20 | .hljs-change, 21 | .apache .hljs-tag, 22 | .apache .hljs-cbracket, 23 | .nginx .hljs-built_in, 24 | .tex .hljs-formula { 25 | color: #888; 26 | } 27 | 28 | .hljs-comment, 29 | .hljs-shebang, 30 | .hljs-doctype, 31 | .hljs-pi, 32 | .hljs-javadoc, 33 | .hljs-deletion, 34 | .apache .hljs-sqbracket { 35 | color: #ccc; 36 | } 37 | 38 | .hljs-keyword, 39 | .hljs-tag .hljs-title, 40 | .ini .hljs-title, 41 | .lisp .hljs-title, 42 | .http .hljs-title, 43 | .nginx .hljs-title, 44 | .css .hljs-tag, 45 | .hljs-winutils, 46 | .hljs-flow, 47 | .apache .hljs-tag, 48 | .tex .hljs-command, 49 | .hljs-request, 50 | .hljs-status { 51 | font-weight: bold; 52 | } 53 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/highlight/styles/brown_papersq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/lib/highlight/styles/brown_papersq.png -------------------------------------------------------------------------------- /docs/landing/static/s/lib/highlight/styles/mono-blue.css: -------------------------------------------------------------------------------- 1 | /* 2 | Five-color theme from a single blue hue. 3 | */ 4 | .hljs { 5 | display: block; 6 | overflow-x: auto; 7 | padding: 0.5em; 8 | background: #eaeef3; 9 | -webkit-text-size-adjust: none; 10 | } 11 | 12 | .hljs, 13 | .hljs-list .hljs-built_in { 14 | color: #00193a; 15 | } 16 | 17 | .hljs-keyword, 18 | .hljs-title, 19 | .hljs-important, 20 | .hljs-request, 21 | .hljs-header, 22 | .hljs-javadoctag { 23 | font-weight: bold; 24 | } 25 | 26 | .hljs-comment, 27 | .hljs-chunk { 28 | color: #738191; 29 | } 30 | 31 | .hljs-string, 32 | .hljs-title, 33 | .hljs-parent, 34 | .hljs-built_in, 35 | .hljs-literal, 36 | .hljs-filename, 37 | .hljs-value, 38 | .hljs-addition, 39 | .hljs-tag, 40 | .hljs-argument, 41 | .hljs-link_label, 42 | .hljs-blockquote, 43 | .hljs-header { 44 | color: #0048ab; 45 | } 46 | 47 | .hljs-decorator, 48 | .hljs-prompt, 49 | .hljs-yardoctag, 50 | .hljs-subst, 51 | .hljs-symbol, 52 | .hljs-doctype, 53 | .hljs-regexp, 54 | .hljs-preprocessor, 55 | .hljs-pragma, 56 | .hljs-pi, 57 | .hljs-attribute, 58 | .hljs-attr_selector, 59 | .hljs-javadoc, 60 | .hljs-xmlDocTag, 61 | .hljs-deletion, 62 | .hljs-shebang, 63 | .hljs-string .hljs-variable, 64 | .hljs-link_url, 65 | .hljs-bullet, 66 | .hljs-sqbracket, 67 | .hljs-phony { 68 | color: #4c81c9; 69 | } 70 | -------------------------------------------------------------------------------- /docs/landing/static/s/lib/highlight/styles/pojoaque.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/lib/highlight/styles/pojoaque.jpg -------------------------------------------------------------------------------- /docs/landing/static/s/lib/highlight/styles/school_book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/lib/highlight/styles/school_book.png -------------------------------------------------------------------------------- /docs/landing/static/s/lib/zeroclipboard/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | /* Enforcing options */ 3 | "bitwise": true, 4 | "camelcase": true, 5 | "curly": true, 6 | "eqeqeq": true, 7 | "es3": true, 8 | "es5": false, 9 | "forin": true, 10 | "freeze": true, 11 | "immed": true, 12 | "indent": 2, 13 | "latedef": true, 14 | "newcap": true, 15 | "noarg": true, 16 | "noempty": true, 17 | "nonbsp": true, 18 | "nonew": true, 19 | "plusplus": false, 20 | "quotmark": "double", 21 | "undef": true, 22 | "unused": true, 23 | "strict": true, 24 | "trailing": true, 25 | "maxparams": 4, 26 | "maxdepth": 5, 27 | "maxstatements": false, 28 | "maxlen": false, /* IDEAL: 120? */ 29 | 30 | 31 | /* Relaxing options */ 32 | "asi": false, 33 | "boss": false, 34 | "debug": false, 35 | "eqnull": true, 36 | "esnext": false, 37 | "evil": false, 38 | "expr": false, 39 | "funcscope": false, 40 | "gcl": false, 41 | "globalstrict": false, 42 | "iterator": false, 43 | "lastsemic": false, 44 | "laxbreak": false, 45 | "laxcomma": false, 46 | "loopfunc": false, 47 | "maxerr": 50, 48 | "moz": false, 49 | "multistr": false, 50 | "notypeof": false, 51 | "proto": false, 52 | "scripturl": false, 53 | "smarttabs": false, 54 | "shadow": false, 55 | "sub": false, 56 | "supernew": false, 57 | "validthis": false, 58 | "noyield": false, 59 | 60 | /* Environments */ 61 | "browser": true, 62 | 63 | /* Global variables */ 64 | "globals": { 65 | /* AMD */ 66 | "define": false, 67 | /* CommonJS */ 68 | "module": false 69 | } 70 | } -------------------------------------------------------------------------------- /docs/landing/static/s/lib/zeroclipboard/ZeroClipboard.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/landing/static/s/lib/zeroclipboard/ZeroClipboard.swf -------------------------------------------------------------------------------- /docs/landing/static/versions.json: -------------------------------------------------------------------------------- 1 | [{"version": "2.9"}, {"version": "2.8"}, {"version": "2.7"}, {"version": "2.6"}, {"version": "2.5"}, {"version": "2.4"}, {"version": "2.3"}, {"version": "2.2"}, {"version": "2.1"}, {"version": "2.0"}, {"version": "1.2"}, {"version": "1.1"}, {"version": "1.0"}] 2 | -------------------------------------------------------------------------------- /docs/reference/config.toml: -------------------------------------------------------------------------------- 1 | baseurl = "/mongo-scala-driver/2.9" 2 | languageCode = "en-us" 3 | title = "MongoDB Scala Driver" 4 | theme = "mongodb" 5 | canonifyurls = false 6 | 7 | [blackfriday] 8 | plainIdAnchors = true 9 | 10 | # Update versions in mongodb.toml as well 11 | [[menu.main]] 12 | name = "API Documentation" 13 | pre = "" 14 | weight = 100 15 | identifier = "apiDocs" 16 | url = "/scaladoc" 17 | 18 | [[menu.main]] 19 | name = "Source Code" 20 | pre = "" 21 | weight = 100 22 | identifier = "githubLink" 23 | url = "https://github.com/mongodb/mongo-scala-driver/tree/master" 24 | -------------------------------------------------------------------------------- /docs/reference/content/bson/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-19T12:53:30-04:00" 3 | title = "BSON" 4 | [menu.main] 5 | identifier = "BSON" 6 | weight = 40 7 | pre = "" 8 | +++ 9 | 10 | ## BSON 11 | 12 | The BSON library comprehensively supports [BSON](http://www.bsonspec.org), the data storage and network transfer format that MongoDB uses for 13 | “documents". BSON, short for Binary [JSON](http://json.org/), is a binary-encoded serialization of JSON-like documents. 14 | 15 | For everyday usage there are type aliases and companion objects available from the [`org.mongodb.scala.bson`]({{< apiref="org.mongodb.scala.bson.package" >}}) package. 16 | 17 | - [Documents]({{< relref "documents.md" >}}): Documentation of the driver's support for BSON document representations 18 | - [Extended JSON]({{< relref "extended-json.md" >}}): Documentation of the driver's support for MongoDB Extended JSON 19 | 20 | For advanced usage you may need to use `org.bson` directly. See the core Java driver documentation for: 21 | 22 | - [Readers and Writers]({{< coredocref "bson/readers-and-writers" >}}): Documentation of the driver's support for stream-based reading and writing 23 | of BSON documents 24 | - [Codec and CodecRegistry]({{< coredocref "bson/codecs" >}}): Documentation of the driver's `Codec` API, an abstraction for producing and 25 | consuming BSON document representations using the stream-based readers and writers 26 | -------------------------------------------------------------------------------- /docs/reference/content/builders/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-19T12:53:30-04:00" 3 | title = "Builders" 4 | [menu.main] 5 | identifier = "Builders" 6 | weight = 50 7 | pre = "" 8 | +++ 9 | 10 | ## Builders 11 | 12 | The driver provides several classes that make it easier to use the CRUD API. 13 | 14 | - [Filters]({{< relref "filters.md" >}}): Documentation of the driver's support for building query filters 15 | - [Projections]({{< relref "projections.md" >}}): Documentation of the driver's support for building projections 16 | - [Sorts]({{< relref "sorts.md" >}}): Documentation of the driver's support for building sort criteria 17 | - [Aggregation]({{< relref "aggregation.md" >}}): Documentation of the driver's support for building aggregation pipelines 18 | - [Updates]({{< relref "updates.md" >}}): Documentation of the driver's support for building updates 19 | - [Indexes]({{< relref "indexes.md" >}}): Documentation of the driver's support for creating index keys 20 | 21 | {{% note class="important" %}} 22 | Builders make use of the [`Bson`]({{< relref "bson/documents.md#bson" >}}) helper which unlike the [`Document`]({{< relref "bson/documents.md#document" >}}) is not type safe. Instead conversion to `BSON` is done via 23 | [Codecs and the CodecRegistry]({{< coredocref "bson/codecs" >}}). 24 | {{% /note %}} 25 | -------------------------------------------------------------------------------- /docs/reference/content/getting-started/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-17T15:36:56Z" 3 | title = "Getting Started" 4 | [menu.main] 5 | identifier = "Getting Started" 6 | weight = 30 7 | pre = "" 8 | +++ 9 | 10 | ## Getting Started 11 | 12 | To help you get started quickly on the new driver, follow: 13 | 14 | * [Installation]({{< ref "getting-started/installation-guide.md" >}}), how to install the Scala driver. 15 | * [Quick Tour Primer]({{< ref "getting-started/quick-tour-primer.md" >}}), background information on the driver and its asynchronous API. 16 | * [Quick Tour]({{< ref "getting-started/quick-tour.md" >}}), an introduction to using the driver for CRUD operations. 17 | * [Quick Tour - case classes]({{< ref "getting-started/quick-tour-case-classes.md" >}}), an introduction to using the driver with case classes. 18 | * [Admin Quick Tour]({{< ref "getting-started/quick-tour-admin.md" >}}), an introduction to using the driver for administrative operations. 19 | -------------------------------------------------------------------------------- /docs/reference/content/getting-started/installation-guide.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-17T15:36:56Z" 3 | title = "Installation Guide" 4 | [menu.main] 5 | parent = "Getting Started" 6 | identifier = "Installation Guide" 7 | weight = 1 8 | pre = "" 9 | +++ 10 | 11 | # Installation 12 | 13 | The recommended way to get started using the driver in your project is with a dependency management system. 14 | 15 | {{< distroPicker >}} 16 | 17 | ## MongoDB Scala Driver 18 | The MongoDB Scala Driver 19 | 20 | ### Scala 2.13 21 | 22 | {{< install artifactId="mongo-scala-driver" version="2.9.0" mongoDriverVersion="3.12.2" scalaVersion="2.13">}} 23 | 24 | ### Scala 2.12 25 | 26 | {{< install artifactId="mongo-scala-driver" version="2.9.0" mongoDriverVersion="3.12.2" scalaVersion="2.12">}} 27 | 28 | ### Scala 2.11 29 | 30 | {{< install artifactId="mongo-scala-driver" version="2.9.0" mongoDriverVersion="3.12.2" scalaVersion="2.11">}} 31 | -------------------------------------------------------------------------------- /docs/reference/content/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-17T15:36:56Z" 3 | title = "MongoDB Scala Driver" 4 | type = "index" 5 | +++ 6 | 7 | ## MongoDB Scala Driver Documentation 8 | 9 | Welcome to the MongoDB Scala driver documentation hub. 10 | 11 | ### Getting Started 12 | 13 | The [Getting Started]({{< relref "getting-started/index.md" >}}) guide contains installation instructions 14 | and a simple tutorial to get up and running quickly. 15 | 16 | 17 | {{% note %}} 18 | This implementation is built upon the MongoDB Async Driver and mirrors it's [API](http://mongodb.github.io/mongo-java-driver/). 19 | 20 | The MongoDB Scala driver provides an idiomatic Scala API that is built on top of the MongoDB Async Java driver. 21 | 22 | In general, you should **only need** the `org.mongodb.scala` and `org.bson` namespaces in your code. You should not need to import from the `com.mongodb` namespace as there are equivalent type aliases and companion objects in the Scala driver. The main exception is for advanced configuration via the builders in [MongoClientSettings]({{< apiref "org/mongodb/scala/MongoClientSettings$">}}) which is considered to be for advanced users. 23 | {{% /note %}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/reference/content/integrations/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-07-19T14:27:51-04:00" 3 | title = "Integrations" 4 | [menu.main] 5 | identifier = "Integrations" 6 | weight = 60 7 | pre = "" 8 | +++ 9 | 10 | # Integrations 11 | 12 | The `Observable`, `Observer` and `Subscription` implementation draws inspiration from the [ReactiveX](http://reactivex.io/) and [reactive streams](http://www.reactive-streams.org) libraries and provides easy interoperability with them. For more information about these classes please see the [quick tour primer]({{< relref "getting-started/quick-tour-primer.md" >}}). 13 | 14 | ## Reactive Streams 15 | 16 | {{< img src="/img/mongoReactiveLogo.png" title="RxScala" class="align-right" >}} 17 | 18 | The [Reactive streams](http://www.reactive-streams.org) initiative provides interfaces that allow reactive stream based systems to interact. The API is similar to the MongoDB `Observable` API but without the composability of the MongoDB implementation. 19 | 20 | Converting from an `Observable` to a `Publisher` is a simple process and can be done in a few short lines of code. An implicit based conversion can be found in the [examples folder]({{< srcref "examples/src/test/scala/rxStreams">}}). 21 | -------------------------------------------------------------------------------- /docs/reference/content/reference/connecting/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-19T12:53:30-04:00" 3 | title = "Connecting" 4 | [menu.main] 5 | parent = "Reference" 6 | identifier = "Connecting" 7 | weight = 30 8 | pre = "" 9 | +++ 10 | 11 | ## Connecting 12 | 13 | The reference documentation for connecting to a MongoDB server deployment is divided into three sections: 14 | 15 | - [Connection Settings]({{}}): documentation of the various ways to specify the properties of a connection 16 | - [Authenticating]({{}}): detailed documentation of the various ways to specify authentication credentials 17 | - [SSL]({{}}): Detailed documentation of the various ways to specify the properties of an SSL connection 18 | -------------------------------------------------------------------------------- /docs/reference/content/reference/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-17T15:36:56Z" 3 | title = "Reference" 4 | [menu.main] 5 | identifier = "Reference" 6 | weight = 30 7 | pre = "" 8 | +++ 9 | 10 | ## Reference 11 | 12 | The reference documentation for the Scala driver focuses on high-level documentation and use-cases. The Scaladoc-generated API reference is 13 | [here]({{< apiref "">}}). 14 | 15 | - [Connecting]({{< relref "reference/connecting/index.md" >}}): Documentation of the driver's support for connecting to MongoDB servers 16 | - [CRUD]({{< relref "reference/crud/index.md" >}}): Documentation of the driver's support for CRUD operations 17 | - [Observables]({{< relref "reference/observables.md" >}}): Documentation of the driver's support and implicit helpers for Observables. 18 | - [Management]({{< relref "reference/management/index.md" >}}): Documentation of the driver's support for logging and monitoring of its 19 | internal state. 20 | 21 | -------------------------------------------------------------------------------- /docs/reference/content/reference/management/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-19T14:27:51-04:00" 3 | title = "Management" 4 | [menu.main] 5 | parent = "Reference" 6 | identifier = "Management" 7 | weight = 80 8 | pre = "" 9 | +++ 10 | 11 | ## Management 12 | 13 | The driver provides two mechanisms for examining its state: 14 | 15 | - [Logging]({{< relref "reference/management/logging.md" >}}): Comprehensive logging of all operations using [SLF4J](http://www.slf4j.org/) 16 | - [Monitoring]({{< relref "reference/management/monitoring.md" >}}): Built on [JMX](http://docs.oracle.com/javase/8/docs/technotes/guides/jmx/) 17 | -------------------------------------------------------------------------------- /docs/reference/content/reference/management/logging.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2015-03-18T21:14:20-04:00" 3 | title = "Logging" 4 | [menu.main] 5 | parent = "Management" 6 | identifier = "Logging" 7 | weight = 10 8 | pre = "" 9 | +++ 10 | 11 | # Logging 12 | 13 | By default, logging is enabled via the popular [SLF4J](http://www.slf4j.org/) API. The use of [SLF4J](http://www.slf4j.org/) is optional; 14 | the driver will use SLF4J if the driver detects the presence of SLF4J in the classpath. Otherwise, the driver will fall back to 15 | JUL (`java.util.logging`). 16 | 17 | The driver uses the following logger names: 18 | 19 | - `org.mongodb.driver`: the root logger 20 | - `cluster`: for logs related to monitoring of the MongoDB servers to which the driver connects 21 | - `connection`: for logs related to connections and connection pools 22 | - `protocol`: for logs related to protocol message sent to and received from a MongoDB server 23 | - `insert`: for logs related to insert messages and responses 24 | - `update`: for logs related to update messages and responses 25 | - `delete`: for logs related to delete messages and responses 26 | - `query`: for logs related to query messages and responses 27 | - `getmore`: for logs related to getmore messages and responses 28 | - `killcursor`: for logs related to killcursor messages and responses 29 | - `command`: for logs related to command messages and responses 30 | - `uri`: for logs related to connection string parsing 31 | - `management`: for logs related to JMX 32 | -------------------------------------------------------------------------------- /docs/reference/data/.readme: -------------------------------------------------------------------------------- 1 | custom data resources 2 | -------------------------------------------------------------------------------- /docs/reference/data/mongodb.toml: -------------------------------------------------------------------------------- 1 | githubUser = "mongodb" 2 | githubRepo = "mongo-scala-driver" 3 | githubBranch = "2.9.x" # Set the branch 4 | currentVersion = "2.9" 5 | highlightTheme = "idea.css" 6 | apiUrl = "/scaladoc" 7 | coreApiUrl = "http://mongodb.github.io/mongo-java-driver/3.12/javadoc" 8 | coreDocsUrl = "http://mongodb.github.io/mongo-java-driver/3.12/" 9 | mongoDriverVersion = "3.12.2" # Update in installation-guide.md 10 | -------------------------------------------------------------------------------- /docs/reference/layouts/.readme: -------------------------------------------------------------------------------- 1 | custom layouts here 2 | -------------------------------------------------------------------------------- /docs/reference/layouts/partials/assets/cssExtras.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /docs/reference/layouts/partials/assets/javascriptExtras.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /docs/reference/layouts/shortcodes/apiref.html: -------------------------------------------------------------------------------- 1 | {{ .Page.Site.BaseUrl }}{{ .Page.Site.Data.mongodb.apiUrl }}/{{ with (.Get 0) }}{{ . }}{{ if ne (in . ".html") true}}.html{{ end }}{{ end }} 2 | -------------------------------------------------------------------------------- /docs/reference/layouts/shortcodes/coreapiref.html: -------------------------------------------------------------------------------- 1 | {{ .Page.Site.Data.mongodb.coreApiUrl }}?{{ with (.Get 0) }}{{ . }}{{ if ne (in . ".html") true}}.html{{ end }}{{ end }} 2 | -------------------------------------------------------------------------------- /docs/reference/layouts/shortcodes/coredocref.html: -------------------------------------------------------------------------------- 1 | {{ .Page.Site.Data.mongodb.coreDocsUrl }}{{ with (.Get 0) }}{{ . }}{{ end }} 2 | -------------------------------------------------------------------------------- /docs/reference/layouts/shortcodes/distroPicker.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /docs/reference/layouts/shortcodes/img.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/reference/static/.readme: -------------------------------------------------------------------------------- 1 | Custom static resources 2 | -------------------------------------------------------------------------------- /docs/reference/static/css/java.css: -------------------------------------------------------------------------------- 1 | .downloadInfo { 2 | margin-top: -24px; 3 | font-size: 13px; 4 | } 5 | .downloadInfo p { 6 | margin: 0px; 7 | } 8 | -------------------------------------------------------------------------------- /docs/reference/static/img/mongoReactiveLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/static/img/mongoReactiveLogo.png -------------------------------------------------------------------------------- /docs/reference/static/img/mongoRxLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/static/img/mongoRxLogo.png -------------------------------------------------------------------------------- /docs/reference/static/js/scala.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function(){ 2 | $('.distroPicker').bootstrapToggle(); 3 | $('.distroPicker').change(function () { 4 | console.log($('.distroPicker').prop('checked')) 5 | if ($('.distroPicker').prop('checked')) { 6 | $('.maven').addClass('hidden'); 7 | $('.sbt').removeClass('hidden'); 8 | } else { 9 | $('.sbt').addClass('hidden'); 10 | $('.maven').removeClass('hidden'); 11 | } 12 | }); 13 | 14 | jQuery.getJSON(DOCUMENTATION_OPTIONS.URL_ROOT + "/../versions.json").done(function( data ) { 15 | 16 | $.each(data, function( index, value ) { 17 | var versionUrl = "//mongodb.github.io/mongo-scala-driver/" + value.version; 18 | var liClass = DOCUMENTATION_OPTIONS.VERSION == value.version ? ' class="active"' : ''; 19 | jQuery("#optionsVersionsMenu").append(''+ value.version +''); 20 | }); 21 | 22 | jQuery("#optionsVersionsPopup").removeClass("hidden"); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /docs/reference/static/lib/bootstrap-toggle/bootstrap-toggle.min.css: -------------------------------------------------------------------------------- 1 | /*! ======================================================================== 2 | * Bootstrap Toggle: bootstrap-toggle.css v2.2.0 3 | * http://www.bootstraptoggle.com 4 | * ======================================================================== 5 | * Copyright 2014 Min Hur, The New York Times Company 6 | * Licensed under MIT 7 | * ======================================================================== */ 8 | .checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px} 9 | .toggle{position:relative;overflow:hidden} 10 | .toggle input[type=checkbox]{display:none} 11 | .toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} 12 | .toggle.off .toggle-group{left:-100%} 13 | .toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} 14 | .toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} 15 | .toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} 16 | .toggle.btn{min-width:59px;min-height:34px} 17 | .toggle-on.btn{padding-right:24px} 18 | .toggle-off.btn{padding-left:24px} 19 | .toggle.btn-lg{min-width:79px;min-height:45px} 20 | .toggle-on.btn-lg{padding-right:31px} 21 | .toggle-off.btn-lg{padding-left:31px} 22 | .toggle-handle.btn-lg{width:40px} 23 | .toggle.btn-sm{min-width:50px;min-height:30px} 24 | .toggle-on.btn-sm{padding-right:20px} 25 | .toggle-off.btn-sm{padding-left:20px} 26 | .toggle.btn-xs{min-width:35px;min-height:22px} 27 | .toggle-on.btn-xs{padding-right:12px} 28 | .toggle-off.btn-xs{padding-left:12px} -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/LICENSE.md: -------------------------------------------------------------------------------- 1 | This work is licensed under a [Creative Commons Attribution NonCommercial ShareAlike 3.0 Unported](http://creativecommons.org/licenses/by-nc-sa/3.0/) License. 2 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | draft=true 3 | +++ 4 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/data/mongodb.toml: -------------------------------------------------------------------------------- 1 | githubRepo = "" 2 | githubBranch = "" 3 | currentVersion = "" 4 | driverVersions = [] 5 | highlightTheme = "default.css" 6 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/_default/li.html: -------------------------------------------------------------------------------- 1 |
  • 2 |
    3 | 8 |
    9 |
  • 10 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 |
    3 |
    4 |

    {{ .Title }}

    5 |
      6 | {{ range .Data.Pages }} 7 | {{ .Render "li"}} 8 | {{ end }} 9 |
    10 |
    11 |
    12 | {{ partial "footer.html" . }} 13 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | {{ partial "header/contentHeader.html" . }} 3 | {{ .Content }} 4 | {{ partial "footer.html" . }} 5 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | {{ $.Scratch.Set "indexFound" false }} 3 | {{ range where .Data.Pages ".Type" "index" }} 4 | {{ $.Scratch.Set "indexFound" true }} 5 | {{ .Content }} 6 | {{ end }} 7 | 8 | {{if eq ($.Scratch.Get "indexFound") false }} 9 | {{ partial "welcome.html" . }} 10 | {{ end }} 11 | 12 | {{ partial "footer.html" . }} 13 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/assets/analytics.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | 12 | 23 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/assets/css.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ partial "assets/cssExtras.html" . }} 7 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/assets/cssExtras.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/layouts/partials/assets/cssExtras.html -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/assets/javascriptExtras.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/layouts/partials/assets/javascriptExtras.html -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/assets/javascripts.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | {{ partial "assets/javascriptExtras.html" . }} 16 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | {{ if .IsPage }} 2 | 3 | {{ $menuPrev := $.Scratch.Get "menu.Prev"}} 4 | {{ $menuNext := $.Scratch.Get "menu.Next"}} 5 | 6 |
    7 | {{ with $menuPrev }} 8 | 13 | {{ end }} 14 | {{ with $menuNext }} 15 |
    16 | 19 | {{ end }} 20 |
    21 |
    22 | {{ end }} 23 | 24 | 25 | {{ partial "rightColumn.html" . }} 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | {{ partial "assets/javascripts.html" . }} 36 | {{ partial "assets/analytics.html" . }} 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ partial "meta.html"}} 5 | 6 | 7 | {{.Title}} 8 | 9 | {{ partial "assets/css.html" . }} 10 | 11 | 12 | 13 | 14 |
    15 | 16 | {{ partial "header/main.html" . }} 17 | 18 | 19 | {{ partial "menu.html" . }} 20 | 21 | 22 |
    23 |
    24 |
    25 |
    26 |
    27 |
    28 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/header/contentHeader.html: -------------------------------------------------------------------------------- 1 | {{ if .IsPage }} 2 | {{ $File := .File }} {{with $File.LogicalName }} {{ $srcref := add (add "docs/reference/content/" $File.Dir) $File.LogicalName }} 3 | 4 | {{end}} 5 | {{end}} 6 | {{ $menuItemL6 := $.Scratch.Get "menu.Item.L6"}} 7 | {{ $menuItemL5 := $.Scratch.Get "menu.Item.L5"}} 8 | {{ $menuItemL4 := $.Scratch.Get "menu.Item.L4"}} 9 | {{ $menuItemL3 := $.Scratch.Get "menu.Item.L3"}} 10 | {{ $menuItemL2 := $.Scratch.Get "menu.Item.L2"}} 11 | {{ $menuItemL1 := $.Scratch.Get "menu.Item.L1"}} 12 | {{ $menuItemL0 := $.Scratch.Get "menu.Item.L0"}} 13 | {{if $menuItemL0}} 14 |
    15 |
      16 | {{with $menuItemL6}}
    • {{.Name}}
    • {{end}} 17 | {{with $menuItemL5}}
    • {{.Name}}
    • {{end}} 18 | {{with $menuItemL4}}
    • {{.Name}}
    • {{end}} 19 | {{with $menuItemL3}}
    • {{.Name}}
    • {{end}} 20 | {{with $menuItemL2}}
    • {{.Name}}
    • {{end}} 21 | {{with $menuItemL1}}
    • {{.Name}}
    • {{end}} 22 |
    • {{$menuItemL0.Name}}
    • 23 |
    24 |
    25 | {{ end }} 26 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/header/main.html: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/header/search.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/header/topRight.html: -------------------------------------------------------------------------------- 1 |
    2 | 10 |
    11 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/menu/footer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/layouts/partials/menu/footer.html -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/menu/options.html: -------------------------------------------------------------------------------- 1 | 29 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/meta.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/rightColumn.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | {{ if .IsPage }} 4 |
    5 | On this page 6 | {{ .TableOfContents}} 7 |
    8 | {{ end }} 9 |
    10 |
    11 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/partials/welcome.html: -------------------------------------------------------------------------------- 1 |

    Welcome to the hugo mongodb docs theme.

    2 | 3 |

    You have two choices when it comes to managing this front page.

    4 | 5 |

    1. Markdown:

    6 | 7 |

    First create your own index page in content: hugo new ./content/index.md

    8 | 9 |

    Set a type in the “front matter” to index eg:

    10 | 11 |
    +++
    12 | date = "2015-03-17T15:36:56Z"
    13 | draft = false
    14 | title = "index"
    15 | type = "index"
    16 | +++
    17 | 
    18 | ## Add your markdown content to your frontpage.
    19 | 
    20 | Hello welcome to my driver docs
    21 | 
    22 | 23 |

    2. HTML

    24 | 25 |

    Create your own layouts\index.html eg:

    26 | 27 |
    {{ partial "header.html" . }}
    28 | 
    29 | <h2>Add your HTML content to your frontpage.</h2>
    30 | 
    31 | {{ partial "footer.html" . }}
    32 | 
    33 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/shortcodes/docsref.html: -------------------------------------------------------------------------------- 1 | http://docs.mongodb.org/manual/{{ .Get 0 }} 2 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/shortcodes/note.html: -------------------------------------------------------------------------------- 1 |
    2 |
    {{if .Get "class"}}{{.Get "class"}}{{else}}Note{{end}}
    3 | {{ .Inner }} 4 |
    5 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/layouts/shortcodes/srcref.html: -------------------------------------------------------------------------------- 1 | https://github.com/mongodb/{{ .Page.Site.Data.mongodb.githubRepo }}/blob/{{ .Page.Site.Data.mongodb.githubBranch }}/{{ if eq (in (.Get 0) "src/") false }}src/{{ end }}{{ .Get 0 }} 2 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/.nojekyll -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/css/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | font-size: 100%; 20 | font: inherit; 21 | vertical-align: baseline; 22 | } 23 | /* HTML5 display-role reset for older browsers */ 24 | article, aside, details, figcaption, figure, 25 | footer, header, hgroup, menu, nav, section { 26 | display: block; 27 | } 28 | body { 29 | line-height: 1; 30 | } 31 | ol, ul { 32 | list-style: none; 33 | } 34 | blockquote, q { 35 | quotes: none; 36 | } 37 | blockquote:before, blockquote:after, 38 | q:before, q:after { 39 | content: ''; 40 | content: none; 41 | } 42 | table { 43 | border-collapse: collapse; 44 | border-spacing: 0; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/favicon.ico -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/24px-baseline-overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/24px-baseline-overlay.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/back-body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/back-body.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/code-block-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/code-block-bg.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/code-block-bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/code-block-bg@2x.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/favicon.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/gray.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/logo-mongodb-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/logo-mongodb-header.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/social-facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/social-facebook.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/social-facebook@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/social-facebook@2x.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/social-gplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/social-gplus.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/social-gplus@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/social-gplus@2x.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/social-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/social-twitter.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/social-twitter@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/social-twitter@2x.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/social-youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/social-youtube.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/social-youtube@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/social-youtube@2x.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/trans-user-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/trans-user-back.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/trans-user-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/trans-user-left.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/img/trans-user-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/img/trans-user-right.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/js/scripts.js: -------------------------------------------------------------------------------- 1 | function initializeJS() { 2 | jQuery('.toggle-nav').click(function () { 3 | if (jQuery('#sidebar > .ssidebar').is(":visible") === true) { 4 | jQuery('#sidebar > .ssidebar').hide(); 5 | jQuery('#sidebar > .nav-footer').hide(); 6 | jQuery("#container").addClass("sidebar-closed"); 7 | } else { 8 | jQuery("#container").removeClass("sidebar-closed"); 9 | jQuery('#sidebar > .ssidebar').show(); 10 | jQuery('#sidebar > .nav-footer').show(); 11 | } 12 | }); 13 | }; 14 | 15 | jQuery(document).ready(function() { 16 | initializeJS(); 17 | jQuery('[data-toggle="tooltip"]').tooltip(); 18 | jQuery("body").addClass("jsEnabled"); 19 | hljs.initHighlightingOnLoad(); 20 | var linkRegex = new RegExp('/' + window.location.host + '/'); 21 | jQuery('a').not('[href*="mailto:"]').each(function () { 22 | if (!linkRegex.test(this.href)) { 23 | $(this).attr('target', '_blank'); 24 | } 25 | }); 26 | jQuery('.body table').addClass('table').addClass('table-striped'); 27 | var siteInput = $('#search input[name="site"]'); 28 | if (siteInput.val().substring(0, 4) != "http") { 29 | siteInput.attr("value", window.location.hostname + siteInput.val()); 30 | } 31 | jQuery("#search form").submit(function() { 32 | $('#search input[name="q"]').attr("value", $('#search input[name="searchQuery"]').val() + ' site:' + $('#search input[name="site"]').val()); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/lib/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/lib/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/lib/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/lib/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .@{fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font-family: FontAwesome; 7 | font-style: normal; 8 | font-weight: normal; 9 | line-height: 1; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "spinning"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: -@fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon-rotate(@degrees, @rotation) { 5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 6 | -webkit-transform: rotate(@degrees); 7 | -moz-transform: rotate(@degrees); 8 | -ms-transform: rotate(@degrees); 9 | -o-transform: rotate(@degrees); 10 | transform: rotate(@degrees); 11 | } 12 | 13 | .fa-icon-flip(@horiz, @vert, @rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 15 | -webkit-transform: scale(@horiz, @vert); 16 | -moz-transform: scale(@horiz, @vert); 17 | -ms-transform: scale(@horiz, @vert); 18 | -o-transform: scale(@horiz, @vert); 19 | transform: scale(@horiz, @vert); 20 | } 21 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 9 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 10 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 11 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/spinning.less: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: spin 2s infinite linear; 6 | -moz-animation: spin 2s infinite linear; 7 | -o-animation: spin 2s infinite linear; 8 | animation: spin 2s infinite linear; 9 | } 10 | 11 | @-moz-keyframes spin { 12 | 0% { -moz-transform: rotate(0deg); } 13 | 100% { -moz-transform: rotate(359deg); } 14 | } 15 | @-webkit-keyframes spin { 16 | 0% { -webkit-transform: rotate(0deg); } 17 | 100% { -webkit-transform: rotate(359deg); } 18 | } 19 | @-o-keyframes spin { 20 | 0% { -o-transform: rotate(0deg); } 21 | 100% { -o-transform: rotate(359deg); } 22 | } 23 | @-ms-keyframes spin { 24 | 0% { -ms-transform: rotate(0deg); } 25 | 100% { -ms-transform: rotate(359deg); } 26 | } 27 | @keyframes spin { 28 | 0% { transform: rotate(0deg); } 29 | 100% { transform: rotate(359deg); } 30 | } 31 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .pull-right { float: right; } 11 | .pull-left { float: left; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.pull-left { margin-right: .3em; } 15 | &.pull-right { margin-left: .3em; } 16 | } 17 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font-family: FontAwesome; 7 | font-style: normal; 8 | font-weight: normal; 9 | line-height: 1; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon-rotate($degrees, $rotation) { 5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation); 6 | -webkit-transform: rotate($degrees); 7 | -moz-transform: rotate($degrees); 8 | -ms-transform: rotate($degrees); 9 | -o-transform: rotate($degrees); 10 | transform: rotate($degrees); 11 | } 12 | 13 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation); 15 | -webkit-transform: scale($horiz, $vert); 16 | -moz-transform: scale($horiz, $vert); 17 | -ms-transform: scale($horiz, $vert); 18 | -o-transform: scale($horiz, $vert); 19 | transform: scale($horiz, $vert); 20 | } 21 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 9 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 10 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 11 | //src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_spinning.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: spin 2s infinite linear; 6 | -moz-animation: spin 2s infinite linear; 7 | -o-animation: spin 2s infinite linear; 8 | animation: spin 2s infinite linear; 9 | } 10 | 11 | @-moz-keyframes spin { 12 | 0% { -moz-transform: rotate(0deg); } 13 | 100% { -moz-transform: rotate(359deg); } 14 | } 15 | @-webkit-keyframes spin { 16 | 0% { -webkit-transform: rotate(0deg); } 17 | 100% { -webkit-transform: rotate(359deg); } 18 | } 19 | @-o-keyframes spin { 20 | 0% { -o-transform: rotate(0deg); } 21 | 100% { -o-transform: rotate(359deg); } 22 | } 23 | @-ms-keyframes spin { 24 | 0% { -ms-transform: rotate(0deg); } 25 | 100% { -ms-transform: rotate(359deg); } 26 | } 27 | @keyframes spin { 28 | 0% { transform: rotate(0deg); } 29 | 100% { transform: rotate(359deg); } 30 | } 31 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "spinning"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/highlight/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Ivan Sagalaev 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of highlight.js nor the names of its contributors 12 | may be used to endorse or promote products derived from this software 13 | without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/highlight/styles/ascetic.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: white; 12 | color: black; 13 | -webkit-text-size-adjust: none; 14 | } 15 | 16 | .hljs-string, 17 | .hljs-tag .hljs-value, 18 | .hljs-filter .hljs-argument, 19 | .hljs-addition, 20 | .hljs-change, 21 | .apache .hljs-tag, 22 | .apache .hljs-cbracket, 23 | .nginx .hljs-built_in, 24 | .tex .hljs-formula { 25 | color: #888; 26 | } 27 | 28 | .hljs-comment, 29 | .hljs-shebang, 30 | .hljs-doctype, 31 | .hljs-pi, 32 | .hljs-javadoc, 33 | .hljs-deletion, 34 | .apache .hljs-sqbracket { 35 | color: #ccc; 36 | } 37 | 38 | .hljs-keyword, 39 | .hljs-tag .hljs-title, 40 | .ini .hljs-title, 41 | .lisp .hljs-title, 42 | .http .hljs-title, 43 | .nginx .hljs-title, 44 | .css .hljs-tag, 45 | .hljs-winutils, 46 | .hljs-flow, 47 | .apache .hljs-tag, 48 | .tex .hljs-command, 49 | .hljs-request, 50 | .hljs-status { 51 | font-weight: bold; 52 | } 53 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/highlight/styles/brown_papersq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/lib/highlight/styles/brown_papersq.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/highlight/styles/mono-blue.css: -------------------------------------------------------------------------------- 1 | /* 2 | Five-color theme from a single blue hue. 3 | */ 4 | .hljs { 5 | display: block; 6 | overflow-x: auto; 7 | padding: 0.5em; 8 | background: #eaeef3; 9 | -webkit-text-size-adjust: none; 10 | } 11 | 12 | .hljs, 13 | .hljs-list .hljs-built_in { 14 | color: #00193a; 15 | } 16 | 17 | .hljs-keyword, 18 | .hljs-title, 19 | .hljs-important, 20 | .hljs-request, 21 | .hljs-header, 22 | .hljs-javadoctag { 23 | font-weight: bold; 24 | } 25 | 26 | .hljs-comment, 27 | .hljs-chunk { 28 | color: #738191; 29 | } 30 | 31 | .hljs-string, 32 | .hljs-title, 33 | .hljs-parent, 34 | .hljs-built_in, 35 | .hljs-literal, 36 | .hljs-filename, 37 | .hljs-value, 38 | .hljs-addition, 39 | .hljs-tag, 40 | .hljs-argument, 41 | .hljs-link_label, 42 | .hljs-blockquote, 43 | .hljs-header { 44 | color: #0048ab; 45 | } 46 | 47 | .hljs-decorator, 48 | .hljs-prompt, 49 | .hljs-yardoctag, 50 | .hljs-subst, 51 | .hljs-symbol, 52 | .hljs-doctype, 53 | .hljs-regexp, 54 | .hljs-preprocessor, 55 | .hljs-pragma, 56 | .hljs-pi, 57 | .hljs-attribute, 58 | .hljs-attr_selector, 59 | .hljs-javadoc, 60 | .hljs-xmlDocTag, 61 | .hljs-deletion, 62 | .hljs-shebang, 63 | .hljs-string .hljs-variable, 64 | .hljs-link_url, 65 | .hljs-bullet, 66 | .hljs-sqbracket, 67 | .hljs-phony { 68 | color: #4c81c9; 69 | } 70 | -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/highlight/styles/pojoaque.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/lib/highlight/styles/pojoaque.jpg -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/static/lib/highlight/styles/school_book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-scala-driver/da018cb34b987038066955578ec32c257881a0fe/docs/reference/themes/mongodb/static/lib/highlight/styles/school_book.png -------------------------------------------------------------------------------- /docs/reference/themes/mongodb/theme.toml: -------------------------------------------------------------------------------- 1 | name = "MongoDB" 2 | license = "Creative Commons Attribution NonCommercial ShareAlike 3.0 Unported" 3 | licenselink = "http://creativecommons.org/licenses/by-nc-sa/3.0/" 4 | description = "A standalone mongodb docs theme, for individual driver homepages" 5 | homepage = "http://mongodb.github.io/mongo-java-driver" 6 | 7 | [author] 8 | name = "MongoDB Java driver authors" 9 | homepage = "http://mongodb.github.io/mongo-java-driver" 10 | 11 | [original] 12 | name = "MongoDB Docs" 13 | homepage = "http://docs.mongodb.org" 14 | repo = "https://github.com/mongodb/docs" 15 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/read/aggregate-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": "ping" 6 | } 7 | ], 8 | "minServerVersion": "3.4", 9 | "tests": [ 10 | { 11 | "description": "Aggregate with collation", 12 | "operation": { 13 | "name": "aggregate", 14 | "arguments": { 15 | "pipeline": [ 16 | { 17 | "$match": { 18 | "x": "PING" 19 | } 20 | } 21 | ], 22 | "collation": { 23 | "locale": "en_US", 24 | "strength": 2 25 | } 26 | } 27 | }, 28 | "outcome": { 29 | "result": [ 30 | { 31 | "_id": 1, 32 | "x": "ping" 33 | } 34 | ] 35 | } 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/read/aggregate.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": 22 10 | }, 11 | { 12 | "_id": 3, 13 | "x": 33 14 | } 15 | ], 16 | "tests": [ 17 | { 18 | "description": "Aggregate with multiple stages", 19 | "operation": { 20 | "name": "aggregate", 21 | "arguments": { 22 | "pipeline": [ 23 | { 24 | "$sort": { 25 | "x": 1 26 | } 27 | }, 28 | { 29 | "$match": { 30 | "_id": { 31 | "$gt": 1 32 | } 33 | } 34 | } 35 | ], 36 | "batchSize": 2 37 | } 38 | }, 39 | "outcome": { 40 | "result": [ 41 | { 42 | "_id": 2, 43 | "x": 22 44 | }, 45 | { 46 | "_id": 3, 47 | "x": 33 48 | } 49 | ] 50 | } 51 | } 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/read/count-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": "PING" 6 | } 7 | ], 8 | "minServerVersion": "3.4", 9 | "tests": [ 10 | { 11 | "description": "Count documents with collation", 12 | "operation": { 13 | "name": "countDocuments", 14 | "arguments": { 15 | "filter": { 16 | "x": "ping" 17 | }, 18 | "collation": { 19 | "locale": "en_US", 20 | "strength": 2 21 | } 22 | } 23 | }, 24 | "outcome": { 25 | "result": 1 26 | } 27 | }, 28 | { 29 | "description": "Deprecated count with collation", 30 | "operation": { 31 | "name": "count", 32 | "arguments": { 33 | "filter": { 34 | "x": "ping" 35 | }, 36 | "collation": { 37 | "locale": "en_US", 38 | "strength": 2 39 | } 40 | } 41 | }, 42 | "outcome": { 43 | "result": 1 44 | } 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/read/count-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [], 3 | "tests": [ 4 | { 5 | "description": "Estimated document count with empty collection", 6 | "operation": { 7 | "name": "estimatedDocumentCount", 8 | "arguments": {} 9 | }, 10 | "outcome": { 11 | "result": 0 12 | } 13 | }, 14 | { 15 | "description": "Count documents with empty collection", 16 | "operation": { 17 | "name": "countDocuments", 18 | "arguments": { 19 | "filter": {} 20 | } 21 | }, 22 | "outcome": { 23 | "result": 0 24 | } 25 | }, 26 | { 27 | "description": "Deprecated count with empty collection", 28 | "operation": { 29 | "name": "count", 30 | "arguments": { 31 | "filter": {} 32 | } 33 | }, 34 | "outcome": { 35 | "result": 0 36 | } 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/read/distinct-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "string": "PING" 6 | }, 7 | { 8 | "_id": 2, 9 | "string": "ping" 10 | } 11 | ], 12 | "minServerVersion": "3.4", 13 | "tests": [ 14 | { 15 | "description": "Distinct with a collation", 16 | "operation": { 17 | "name": "distinct", 18 | "arguments": { 19 | "fieldName": "string", 20 | "collation": { 21 | "locale": "en_US", 22 | "strength": 2 23 | } 24 | } 25 | }, 26 | "outcome": { 27 | "result": [ 28 | "PING" 29 | ] 30 | } 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/read/distinct.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": 22 10 | }, 11 | { 12 | "_id": 3, 13 | "x": 33 14 | } 15 | ], 16 | "tests": [ 17 | { 18 | "description": "Distinct without a filter", 19 | "operation": { 20 | "name": "distinct", 21 | "arguments": { 22 | "fieldName": "x", 23 | "filter": {} 24 | } 25 | }, 26 | "outcome": { 27 | "result": [ 28 | 11, 29 | 22, 30 | 33 31 | ] 32 | } 33 | }, 34 | { 35 | "description": "Distinct with a filter", 36 | "operation": { 37 | "name": "distinct", 38 | "arguments": { 39 | "fieldName": "x", 40 | "filter": { 41 | "_id": { 42 | "$gt": 1 43 | } 44 | } 45 | } 46 | }, 47 | "outcome": { 48 | "result": [ 49 | 22, 50 | 33 51 | ] 52 | } 53 | } 54 | ] 55 | } 56 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/read/find-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": "ping" 6 | } 7 | ], 8 | "minServerVersion": "3.4", 9 | "tests": [ 10 | { 11 | "description": "Find with a collation", 12 | "operation": { 13 | "name": "find", 14 | "arguments": { 15 | "filter": { 16 | "x": "PING" 17 | }, 18 | "collation": { 19 | "locale": "en_US", 20 | "strength": 2 21 | } 22 | } 23 | }, 24 | "outcome": { 25 | "result": [ 26 | { 27 | "_id": 1, 28 | "x": "ping" 29 | } 30 | ] 31 | } 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/deleteMany-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | }, 11 | { 12 | "_id": 3, 13 | "x": "pINg" 14 | } 15 | ], 16 | "minServerVersion": "3.4", 17 | "tests": [ 18 | { 19 | "description": "DeleteMany when many documents match with collation", 20 | "operation": { 21 | "name": "deleteMany", 22 | "arguments": { 23 | "filter": { 24 | "x": "PING" 25 | }, 26 | "collation": { 27 | "locale": "en_US", 28 | "strength": 2 29 | } 30 | } 31 | }, 32 | "outcome": { 33 | "result": { 34 | "deletedCount": 2 35 | }, 36 | "collection": { 37 | "data": [ 38 | { 39 | "_id": 1, 40 | "x": 11 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/deleteMany.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": 22 10 | }, 11 | { 12 | "_id": 3, 13 | "x": 33 14 | } 15 | ], 16 | "tests": [ 17 | { 18 | "description": "DeleteMany when many documents match", 19 | "operation": { 20 | "name": "deleteMany", 21 | "arguments": { 22 | "filter": { 23 | "_id": { 24 | "$gt": 1 25 | } 26 | } 27 | } 28 | }, 29 | "outcome": { 30 | "result": { 31 | "deletedCount": 2 32 | }, 33 | "collection": { 34 | "data": [ 35 | { 36 | "_id": 1, 37 | "x": 11 38 | } 39 | ] 40 | } 41 | } 42 | }, 43 | { 44 | "description": "DeleteMany when no document matches", 45 | "operation": { 46 | "name": "deleteMany", 47 | "arguments": { 48 | "filter": { 49 | "_id": 4 50 | } 51 | } 52 | }, 53 | "outcome": { 54 | "result": { 55 | "deletedCount": 0 56 | }, 57 | "collection": { 58 | "data": [ 59 | { 60 | "_id": 1, 61 | "x": 11 62 | }, 63 | { 64 | "_id": 2, 65 | "x": 22 66 | }, 67 | { 68 | "_id": 3, 69 | "x": 33 70 | } 71 | ] 72 | } 73 | } 74 | } 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/deleteOne-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | }, 11 | { 12 | "_id": 3, 13 | "x": "pINg" 14 | } 15 | ], 16 | "minServerVersion": "3.4", 17 | "tests": [ 18 | { 19 | "description": "DeleteOne when many documents matches with collation", 20 | "operation": { 21 | "name": "deleteOne", 22 | "arguments": { 23 | "filter": { 24 | "x": "PING" 25 | }, 26 | "collation": { 27 | "locale": "en_US", 28 | "strength": 2 29 | } 30 | } 31 | }, 32 | "outcome": { 33 | "result": { 34 | "deletedCount": 1 35 | }, 36 | "collection": { 37 | "data": [ 38 | { 39 | "_id": 1, 40 | "x": 11 41 | }, 42 | { 43 | "_id": 3, 44 | "x": "pINg" 45 | } 46 | ] 47 | } 48 | } 49 | } 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/findOneAndDelete-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | }, 11 | { 12 | "_id": 3, 13 | "x": "pINg" 14 | } 15 | ], 16 | "minServerVersion": "3.4", 17 | "tests": [ 18 | { 19 | "description": "FindOneAndDelete when one document matches with collation", 20 | "operation": { 21 | "name": "findOneAndDelete", 22 | "arguments": { 23 | "filter": { 24 | "_id": 2, 25 | "x": "PING" 26 | }, 27 | "projection": { 28 | "x": 1, 29 | "_id": 0 30 | }, 31 | "sort": { 32 | "x": 1 33 | }, 34 | "collation": { 35 | "locale": "en_US", 36 | "strength": 2 37 | } 38 | } 39 | }, 40 | "outcome": { 41 | "result": { 42 | "x": "ping" 43 | }, 44 | "collection": { 45 | "data": [ 46 | { 47 | "_id": 1, 48 | "x": 11 49 | }, 50 | { 51 | "_id": 3, 52 | "x": "pINg" 53 | } 54 | ] 55 | } 56 | } 57 | } 58 | ] 59 | } 60 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/findOneAndReplace-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | } 11 | ], 12 | "minServerVersion": "3.4", 13 | "tests": [ 14 | { 15 | "description": "FindOneAndReplace when one document matches with collation returning the document after modification", 16 | "operation": { 17 | "name": "findOneAndReplace", 18 | "arguments": { 19 | "filter": { 20 | "x": "PING" 21 | }, 22 | "replacement": { 23 | "x": "pong" 24 | }, 25 | "projection": { 26 | "x": 1, 27 | "_id": 0 28 | }, 29 | "returnDocument": "After", 30 | "sort": { 31 | "x": 1 32 | }, 33 | "collation": { 34 | "locale": "en_US", 35 | "strength": 2 36 | } 37 | } 38 | }, 39 | "outcome": { 40 | "result": { 41 | "x": "pong" 42 | }, 43 | "collection": { 44 | "data": [ 45 | { 46 | "_id": 1, 47 | "x": 11 48 | }, 49 | { 50 | "_id": 2, 51 | "x": "pong" 52 | } 53 | ] 54 | } 55 | } 56 | } 57 | ] 58 | } 59 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/findOneAndUpdate-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | }, 11 | { 12 | "_id": 3, 13 | "x": "pINg" 14 | } 15 | ], 16 | "minServerVersion": "3.4", 17 | "tests": [ 18 | { 19 | "description": "FindOneAndUpdate when many documents match with collation returning the document before modification", 20 | "operation": { 21 | "name": "findOneAndUpdate", 22 | "arguments": { 23 | "filter": { 24 | "x": "PING" 25 | }, 26 | "update": { 27 | "$set": { 28 | "x": "pong" 29 | } 30 | }, 31 | "projection": { 32 | "x": 1, 33 | "_id": 0 34 | }, 35 | "sort": { 36 | "_id": 1 37 | }, 38 | "collation": { 39 | "locale": "en_US", 40 | "strength": 2 41 | } 42 | } 43 | }, 44 | "outcome": { 45 | "result": { 46 | "x": "ping" 47 | }, 48 | "collection": { 49 | "data": [ 50 | { 51 | "_id": 1, 52 | "x": 11 53 | }, 54 | { 55 | "_id": 2, 56 | "x": "pong" 57 | }, 58 | { 59 | "_id": 3, 60 | "x": "pINg" 61 | } 62 | ] 63 | } 64 | } 65 | } 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/insertOne.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | } 7 | ], 8 | "tests": [ 9 | { 10 | "description": "InsertOne with a non-existing document", 11 | "operation": { 12 | "name": "insertOne", 13 | "arguments": { 14 | "document": { 15 | "_id": 2, 16 | "x": 22 17 | } 18 | } 19 | }, 20 | "outcome": { 21 | "result": { 22 | "insertedId": 2 23 | }, 24 | "collection": { 25 | "data": [ 26 | { 27 | "_id": 1, 28 | "x": 11 29 | }, 30 | { 31 | "_id": 2, 32 | "x": 22 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/replaceOne-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | } 11 | ], 12 | "minServerVersion": "3.4", 13 | "tests": [ 14 | { 15 | "description": "ReplaceOne when one document matches with collation", 16 | "operation": { 17 | "name": "replaceOne", 18 | "arguments": { 19 | "filter": { 20 | "x": "PING" 21 | }, 22 | "replacement": { 23 | "_id": 2, 24 | "x": "pong" 25 | }, 26 | "collation": { 27 | "locale": "en_US", 28 | "strength": 2 29 | } 30 | } 31 | }, 32 | "outcome": { 33 | "result": { 34 | "matchedCount": 1, 35 | "modifiedCount": 1, 36 | "upsertedCount": 0 37 | }, 38 | "collection": { 39 | "data": [ 40 | { 41 | "_id": 1, 42 | "x": 11 43 | }, 44 | { 45 | "_id": 2, 46 | "x": "pong" 47 | } 48 | ] 49 | } 50 | } 51 | } 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/updateMany-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | }, 11 | { 12 | "_id": 3, 13 | "x": "pINg" 14 | } 15 | ], 16 | "minServerVersion": "3.4", 17 | "tests": [ 18 | { 19 | "description": "UpdateMany when many documents match with collation", 20 | "operation": { 21 | "name": "updateMany", 22 | "arguments": { 23 | "filter": { 24 | "x": "ping" 25 | }, 26 | "update": { 27 | "$set": { 28 | "x": "pong" 29 | } 30 | }, 31 | "collation": { 32 | "locale": "en_US", 33 | "strength": 2 34 | } 35 | } 36 | }, 37 | "outcome": { 38 | "result": { 39 | "matchedCount": 2, 40 | "modifiedCount": 2, 41 | "upsertedCount": 0 42 | }, 43 | "collection": { 44 | "data": [ 45 | { 46 | "_id": 1, 47 | "x": 11 48 | }, 49 | { 50 | "_id": 2, 51 | "x": "pong" 52 | }, 53 | { 54 | "_id": 3, 55 | "x": "pong" 56 | } 57 | ] 58 | } 59 | } 60 | } 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /driver/src/it/resources/crud/write/updateOne-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | } 11 | ], 12 | "minServerVersion": "3.4", 13 | "tests": [ 14 | { 15 | "description": "UpdateOne when one document matches with collation", 16 | "operation": { 17 | "name": "updateOne", 18 | "arguments": { 19 | "filter": { 20 | "x": "PING" 21 | }, 22 | "update": { 23 | "$set": { 24 | "x": "pong" 25 | } 26 | }, 27 | "collation": { 28 | "locale": "en_US", 29 | "strength": 2 30 | } 31 | } 32 | }, 33 | "outcome": { 34 | "result": { 35 | "matchedCount": 1, 36 | "modifiedCount": 1, 37 | "upsertedCount": 0 38 | }, 39 | "collection": { 40 | "data": [ 41 | { 42 | "_id": 1, 43 | "x": 11 44 | }, 45 | { 46 | "_id": 2, 47 | "x": "pong" 48 | } 49 | ] 50 | } 51 | } 52 | } 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /driver/src/it/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/ClientEncryptionSettings.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ package org.mongodb.scala 16 | 17 | import com.mongodb.{ClientEncryptionSettings => JClientEncryptionSettings} 18 | 19 | /** 20 | * The client-side settings for data key creation and explicit encryption. 21 | * 22 | * Explicit encryption/decryption is a community feature, enabled with the new `com.mongodb.client.vault.ClientEncryption` type, 23 | * for which this is the settings. 24 | * 25 | * @since 2.7 26 | */ 27 | object ClientEncryptionSettings { 28 | 29 | /** 30 | * Gets a Builder for creating a new AutoEncryptionSettings instance. 31 | * 32 | * @return a new Builder for creating AutoEncryptionSettings. 33 | */ 34 | def builder(): Builder = JClientEncryptionSettings.builder() 35 | 36 | /** 37 | * AutoEncryptionSettings builder type 38 | */ 39 | type Builder = JClientEncryptionSettings.Builder 40 | } 41 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/ClientSessionOptions.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import com.mongodb.{ClientSessionOptions => JClientSessionOptions} 20 | 21 | /** 22 | * The options to apply to a `ClientSession`. 23 | * 24 | * @see ClientSession 25 | * @since 2.2 26 | */ 27 | object ClientSessionOptions { 28 | 29 | /** 30 | * Gets an instance of a builder 31 | * 32 | * @return a builder instance 33 | */ 34 | def builder(): Builder = JClientSessionOptions.builder 35 | 36 | /** 37 | * Gets an instance of a builder initialized with the given options 38 | * 39 | * @param clientSessionOptions the options with which to initialize the builder 40 | * @return a builder instance 41 | * @since 2.4 42 | */ 43 | def builder(clientSessionOptions: ClientSessionOptions): Builder = JClientSessionOptions.builder(clientSessionOptions) 44 | 45 | /** 46 | * ClientSession builder 47 | */ 48 | type Builder = JClientSessionOptions.Builder 49 | 50 | } 51 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/Completed.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | /** 20 | * Represents the result of completed operation that produces no real results. 21 | * 22 | * This allows [[Observable]]s to be composed rather than just completing without a result. 23 | */ 24 | case class Completed() { 25 | override def toString: String = "The operation completed successfully" 26 | } 27 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/Helpers.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import java.util.concurrent.Executor 20 | 21 | import scala.concurrent.ExecutionContext 22 | import scala.language.implicitConversions 23 | import scala.reflect.ClassTag 24 | 25 | /** 26 | * Custom helpers for the client 27 | */ 28 | private[scala] object Helpers { 29 | 30 | /** 31 | * Helper to get the class from a classTag 32 | * 33 | * @param ct the classTag we want to implicitly get the class of 34 | * @tparam C the class type 35 | * @return the classOf[C] 36 | */ 37 | implicit def classTagToClassOf[C](ct: ClassTag[C]): Class[C] = ct.runtimeClass.asInstanceOf[Class[C]] 38 | 39 | /** 40 | * Direct Execution Context uses the current context to run the command in. 41 | */ 42 | final val DirectExecutionContext: ExecutionContext = ExecutionContext.fromExecutor(new Executor { 43 | override def execute(command: Runnable): Unit = command.run() 44 | }) 45 | } 46 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/MongoClientSettings.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import com.mongodb.async.client.{MongoClients => JMongoClients} 20 | import com.mongodb.{MongoClientSettings => JMongoClientSettings} 21 | 22 | /** 23 | * A MongoClientSettings companion object 24 | * 25 | * @since 1.0 26 | */ 27 | object MongoClientSettings { 28 | 29 | /** 30 | * Creates a the default builder 31 | * @return a MongoClientSettings builder 32 | */ 33 | def builder(): Builder = JMongoClientSettings.builder().codecRegistry(MongoClient.DEFAULT_CODEC_REGISTRY) 34 | 35 | /** 36 | * Creates a builder from an existing `MongoClientSettings`. 37 | * 38 | * @param settings the settings to create the builder from 39 | * @return a MongoClientSettings builder 40 | */ 41 | def builder(settings: MongoClientSettings): Builder = { 42 | val builder = JMongoClientSettings.builder(settings) 43 | if (settings.getCodecRegistry == JMongoClients.getDefaultCodecRegistry) { 44 | builder.codecRegistry(MongoClient.DEFAULT_CODEC_REGISTRY) 45 | } 46 | builder 47 | } 48 | 49 | /** 50 | * MongoClientSettings builder type 51 | */ 52 | type Builder = JMongoClientSettings.Builder 53 | 54 | } 55 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/MongoCompressor.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import com.mongodb.{MongoCompressor => JMongoCompressor} 20 | 21 | /** 22 | * Metadata describing a compressor to use for sending and receiving messages to a MongoDB server. 23 | * 24 | * @since 2.2 25 | * @note Requires MongoDB 3.4 or greater 26 | */ 27 | object MongoCompressor { 28 | 29 | /** 30 | * Create an instance for snappy compression. 31 | * 32 | * @return A compressor based on the snappy compression algorithm 33 | */ 34 | def createSnappyCompressor: MongoCompressor = JMongoCompressor.createSnappyCompressor() 35 | 36 | /** 37 | * Create an instance for zlib compression. 38 | * 39 | * @return A compressor based on the zlib compression algorithm 40 | * @note Requires MongoDB 3.6 or greater 41 | */ 42 | def createZlibCompressor: MongoCompressor = JMongoCompressor.createZlibCompressor() 43 | } 44 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/MongoDriverInformation.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import com.mongodb.{MongoDriverInformation => JMongoDriverInformation} 20 | 21 | /** 22 | * The options regarding collation support in MongoDB 3.4+ 23 | * 24 | * @note Requires MongoDB 3.4 or greater 25 | * @since 1.2 26 | */ 27 | object MongoDriverInformation { 28 | 29 | /** 30 | * Creates a builder for creating the MongoDriverInformation. 31 | * 32 | * @return a new Builder for creating the MongoDriverInformation. 33 | */ 34 | def builder(): Builder = JMongoDriverInformation.builder() 35 | 36 | /** 37 | * Creates a builder for creating the MongoDriverInformation. 38 | * 39 | * @param mongoDriverInformation existing MongoDriverInformation to be extended. 40 | * @return a new Builder for creating the MongoDriverInformation. 41 | */ 42 | def builder(mongoDriverInformation: MongoDriverInformation): Builder = 43 | JMongoDriverInformation.builder(mongoDriverInformation) 44 | 45 | /** 46 | * MongoDriverInformation builder type 47 | */ 48 | type Builder = JMongoDriverInformation.Builder 49 | 50 | } 51 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/MongoNamespace.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import com.mongodb.{MongoNamespace => JMongoNamespace} 20 | 21 | /** 22 | * A companion object for MongoNamespace 23 | * 24 | * @since 1.0 25 | */ 26 | object MongoNamespace { 27 | def apply(namespace: String): JMongoNamespace = new JMongoNamespace(namespace) 28 | def apply(databaseName: String, collectionName: String): JMongoNamespace = new JMongoNamespace(databaseName, collectionName) 29 | } 30 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/Tag.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import com.mongodb.{Tag => JTag} 20 | 21 | /** 22 | * A replica set tag. 23 | */ 24 | object Tag { 25 | def apply(name: String, value: String): Tag = new JTag(name, value) 26 | } 27 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/TagSet.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import scala.collection.JavaConverters._ 20 | 21 | import com.mongodb.{TagSet => JTagSet} 22 | 23 | /** 24 | * An immutable set of tags, used to select members of a replica set to use for read operations. 25 | */ 26 | object TagSet { 27 | 28 | /** 29 | * An empty set of tags. 30 | */ 31 | def apply(): TagSet = new JTagSet() 32 | 33 | /** 34 | * A set of tags contain the single given tag 35 | * 36 | * @param tag the tag 37 | */ 38 | def apply(tag: Tag): TagSet = new JTagSet(tag) 39 | 40 | /** 41 | * A set of tags containing the given list of tags. 42 | * 43 | * @param tagList the list of tags 44 | */ 45 | def apply(tagList: Seq[Tag]): TagSet = new JTagSet(tagList.asJava) 46 | } 47 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/TransactionOptions.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import com.mongodb.{TransactionOptions => JTransactionOptions} 20 | 21 | /** 22 | * The options to apply to transactions. 23 | * 24 | * @see TransactionOptions 25 | * @since 2.4 26 | */ 27 | object TransactionOptions { 28 | 29 | /** 30 | * Gets an instance of a builder 31 | * 32 | * @return a builder instance 33 | */ 34 | def builder(): Builder = JTransactionOptions.builder() 35 | 36 | /** 37 | * TransactionOptions builder type 38 | */ 39 | type Builder = JTransactionOptions.Builder 40 | 41 | } 42 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/connection/AsynchronousSocketChannelStreamFactoryFactory.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.connection 18 | 19 | import com.mongodb.connection.{AsynchronousSocketChannelStreamFactoryFactory => JAsynchronousSocketChannelStreamFactoryFactory} 20 | 21 | /** 22 | * A `StreamFactoryFactory` implementation for AsynchronousSocketChannel-based streams. 23 | * 24 | * @see java.nio.channels.AsynchronousSocketChannel 25 | * @since 1.0 26 | */ 27 | object AsynchronousSocketChannelStreamFactoryFactory { 28 | /** 29 | * A `StreamFactoryFactory` implementation for AsynchronousSocketChannel-based streams. 30 | */ 31 | def apply(): StreamFactoryFactory = JAsynchronousSocketChannelStreamFactoryFactory.builder().build() 32 | 33 | /** 34 | * Create a builder for AsynchronousSocketChannel-based streams 35 | * 36 | * @return the builder 37 | * @since 2.2 38 | */ 39 | def builder(): Builder = JAsynchronousSocketChannelStreamFactoryFactory.builder() 40 | 41 | /** 42 | * AsynchronousSocketChannelStreamFactoryFactory builder type 43 | */ 44 | type Builder = JAsynchronousSocketChannelStreamFactoryFactory.Builder 45 | } 46 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/connection/ClusterSettings.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.connection 18 | 19 | import com.mongodb.connection.{ClusterSettings => JClusterSettings} 20 | 21 | /** 22 | * Settings for the cluster. 23 | * 24 | * @since 1.0 25 | */ 26 | object ClusterSettings { 27 | /** 28 | * Get a builder for this class. 29 | * 30 | * @return a new Builder for creating ClusterSettings. 31 | */ 32 | def builder(): Builder = JClusterSettings.builder() 33 | 34 | /** 35 | * ClusterSettings builder type 36 | */ 37 | type Builder = JClusterSettings.Builder 38 | 39 | } 40 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/connection/ConnectionPoolSettings.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.connection 18 | 19 | import com.mongodb.connection.{ConnectionPoolSettings => JConnectionPoolSettings} 20 | 21 | /** 22 | * All settings that relate to the pool of connections to a MongoDB server. 23 | * 24 | * @since 1.0 25 | */ 26 | object ConnectionPoolSettings { 27 | 28 | /** 29 | * Gets a Builder for creating a new ConnectionPoolSettings instance. 30 | * 31 | * @return a new Builder for creating ClusterSettings. 32 | */ 33 | def builder(): Builder = JConnectionPoolSettings.builder() 34 | 35 | /** 36 | * ConnectionPoolSettings builder type 37 | */ 38 | type Builder = JConnectionPoolSettings.Builder 39 | 40 | } 41 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/connection/NettyStreamFactoryFactory.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.connection 18 | 19 | import com.mongodb.connection.netty.{NettyStreamFactoryFactory => JNettyStreamFactoryFactory} 20 | 21 | /** 22 | * A `StreamFactoryFactory` implementation for Netty-based streams. 23 | * 24 | * @since 1.0 25 | */ 26 | object NettyStreamFactoryFactory { 27 | def apply(): StreamFactoryFactory = JNettyStreamFactoryFactory.builder().build() 28 | 29 | /** 30 | * Create a builder for Netty-based streams 31 | * 32 | * @return the builder 33 | * @since 2.2 34 | */ 35 | def builder(): Builder = JNettyStreamFactoryFactory.builder() 36 | 37 | /** 38 | * NettyStreamFactoryFactory builder type 39 | */ 40 | type Builder = JNettyStreamFactoryFactory.Builder 41 | } 42 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/connection/ServerSettings.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.connection 18 | 19 | import com.mongodb.connection.{ServerSettings => JServerSettings} 20 | 21 | /** 22 | * Settings relating to monitoring of each server. 23 | * 24 | * @since 1.0 25 | */ 26 | object ServerSettings { 27 | 28 | /** 29 | * Creates a builder for ServerSettings. 30 | * 31 | * @return a new Builder for creating ServerSettings. 32 | */ 33 | def builder(): Builder = JServerSettings.builder() 34 | 35 | /** 36 | * ServerSettings builder type 37 | */ 38 | type Builder = JServerSettings.Builder 39 | 40 | } 41 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/connection/SocketSettings.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.connection 18 | 19 | import com.mongodb.connection.{SocketSettings => JSocketSettings} 20 | 21 | /** 22 | * An immutable class representing socket settings used for connections to a MongoDB server. 23 | * 24 | * @since 1.0 25 | */ 26 | object SocketSettings { 27 | 28 | /** 29 | * Creates a builder for SocketSettings. 30 | * 31 | * @return a new Builder for creating SocketSettings. 32 | */ 33 | def builder(): Builder = JSocketSettings.builder() 34 | 35 | /** 36 | * SocketSettings builder type 37 | */ 38 | type Builder = JSocketSettings.Builder 39 | 40 | } 41 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/connection/SslSettings.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.connection 18 | 19 | import com.mongodb.connection.{SslSettings => JSslSettings} 20 | 21 | /** 22 | * Settings for connecting to MongoDB via SSL. 23 | * 24 | * @since 1.0 25 | */ 26 | object SslSettings { 27 | 28 | /** 29 | * Gets a Builder for creating a new SSLSettings instance. 30 | * 31 | * @return a new Builder for creating SslSettings. 32 | */ 33 | def builder(): Builder = JSslSettings.builder() 34 | 35 | /** 36 | * SslSettings builder type 37 | */ 38 | type Builder = JSslSettings.Builder 39 | 40 | } 41 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/gridfs/AsyncOutputStream.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.gridfs 18 | 19 | import java.nio.ByteBuffer 20 | 21 | import org.mongodb.scala.{Completed, Observable} 22 | 23 | /** 24 | * The Async Output Stream interface represents some asynchronous output stream of bytes. 25 | * 26 | * See the [[org.mongodb.scala.gridfs.helpers]] package for adapters that create an `AsyncOutputStream` 27 | * 28 | * @since 1.2 29 | */ 30 | @deprecated("Use `Observable[ByteBuffer]` instead", "2.8.0") 31 | trait AsyncOutputStream { 32 | /** 33 | * Writes a sequence of bytes from the given buffer into this stream. 34 | * 35 | * @param src the source buffer containing the data to be written. 36 | * @return a Observable returning a single element containing the number of bytes written. 37 | */ 38 | def write(src: ByteBuffer): Observable[Int] 39 | 40 | /** 41 | * Closes the output stream 42 | * 43 | * @return a Observable with a single element indicating when the AsyncOutputStream has been closed 44 | */ 45 | def close(): Observable[Completed] 46 | } 47 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/gridfs/helpers/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.gridfs 18 | 19 | /** 20 | * Contains helper classes to create [[org.mongodb.scala.gridfs.AsyncInputStream]] or [[org.mongodb.scala.gridfs.AsyncOutputStream]] 21 | * instances from external sources. 22 | */ 23 | package object helpers { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/internal/AndThenObservable.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.internal 18 | 19 | import scala.util.{Failure, Try} 20 | 21 | import org.mongodb.scala.{Observable, Observer, Subscription} 22 | 23 | private[scala] case class AndThenObservable[T, U](observable: Observable[T], pf: PartialFunction[Try[T], U]) extends Observable[T] { 24 | override def subscribe(observer: Observer[_ >: T]): Unit = { 25 | observable.subscribe(SubscriptionCheckingObserver[T]( 26 | new Observer[T] { 27 | private var finalResult: Option[T] = None 28 | 29 | override def onError(throwable: Throwable): Unit = { 30 | observer.onError(throwable) 31 | Try(pf(Failure(throwable))) 32 | } 33 | 34 | override def onSubscribe(sub: Subscription): Unit = { 35 | observer.onSubscribe(sub) 36 | } 37 | 38 | override def onComplete(): Unit = { 39 | observer.onComplete() 40 | Try(pf(Try(finalResult.get))) 41 | } 42 | 43 | override def onNext(tResult: T): Unit = { 44 | finalResult = Some(tResult) 45 | observer.onNext(tResult) 46 | } 47 | } 48 | )) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/internal/MapObservable.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.internal 18 | 19 | import org.mongodb.scala.{Observable, Observer, Subscription} 20 | 21 | private[scala] case class MapObservable[T, S](observable: Observable[T], s: T => S, 22 | f: Throwable => Throwable = t => t) extends Observable[S] { 23 | override def subscribe(observer: Observer[_ >: S]): Unit = { 24 | observable.subscribe(SubscriptionCheckingObserver( 25 | new Observer[T] { 26 | override def onError(throwable: Throwable): Unit = observer.onError(f(throwable)) 27 | 28 | override def onSubscribe(subscription: Subscription): Unit = observer.onSubscribe(subscription) 29 | 30 | override def onComplete(): Unit = observer.onComplete() 31 | 32 | override def onNext(tResult: T): Unit = observer.onNext(s(tResult)) 33 | } 34 | )) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/internal/RecoverObservable.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.internal 18 | 19 | import scala.util.{Failure, Success, Try} 20 | 21 | import org.mongodb.scala._ 22 | 23 | private[scala] case class RecoverObservable[T, U >: T]( 24 | observable: Observable[T], 25 | pf: PartialFunction[Throwable, U] 26 | ) extends Observable[U] { 27 | 28 | override def subscribe(observer: Observer[_ >: U]): Unit = { 29 | observable.subscribe(SubscriptionCheckingObserver( 30 | new Observer[U] { 31 | override def onError(throwable: Throwable): Unit = { 32 | Try(pf(throwable)) match { 33 | case Success(res) => { 34 | observer.onNext(res) 35 | observer.onComplete() 36 | } 37 | case Failure(ex) => observer.onError(throwable) 38 | } 39 | } 40 | 41 | override def onSubscribe(subscription: Subscription): Unit = observer.onSubscribe(subscription) 42 | 43 | override def onComplete(): Unit = observer.onComplete() 44 | 45 | override def onNext(tResult: U): Unit = observer.onNext(tResult) 46 | } 47 | )) 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/internal/SingleItemObservable.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.internal 18 | 19 | import org.mongodb.scala.{Observer, SingleObservable, Subscription} 20 | 21 | private[scala] case class SingleItemObservable[A](item: A) extends SingleObservable[A] { 22 | 23 | override def subscribe(observer: Observer[_ >: A]): Unit = { 24 | observer.onSubscribe( 25 | new Subscription { 26 | @volatile 27 | private var subscribed: Boolean = true 28 | 29 | override def isUnsubscribed: Boolean = !subscribed 30 | 31 | override def request(n: Long): Unit = { 32 | require(n > 0L, s"Number requested must be greater than zero: $n") 33 | 34 | if (subscribed) { 35 | observer.onNext(item) 36 | observer.onComplete() 37 | } 38 | } 39 | 40 | override def unsubscribe(): Unit = subscribed = false 41 | } 42 | ) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/internal/WriteConcernImplicits.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.internal 18 | 19 | import java.util.concurrent.TimeUnit 20 | 21 | import scala.concurrent.duration.Duration 22 | 23 | import com.mongodb.{WriteConcern => JWriteConcern} 24 | 25 | import org.mongodb.scala.WriteConcern 26 | 27 | private[scala] trait WriteConcernImplicits { 28 | 29 | implicit class ScalaWriteConcern[T](jWriteConcern: JWriteConcern) { 30 | 31 | /** 32 | * Constructs a new WriteConcern from the current one and the specified wTimeout in the given time unit. 33 | * 34 | * @param wTimeout the wTimeout, which must be >= 0 and <= Integer.MAX_VALUE after conversion to milliseconds 35 | * @return the WriteConcern with the given wTimeout 36 | */ 37 | def withWTimeout(wTimeout: Duration): WriteConcern = jWriteConcern.withWTimeout(wTimeout.toMillis, TimeUnit.MILLISECONDS) 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/internal/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | /** 20 | * Internal companion objects for easy interaction with the Java based async library 21 | * 22 | * @note Not directly accessible but accessible via package objects and aliases. 23 | * Mirrors the async package naming convention and locations but under the `org.mongodb.scala` namespace 24 | * @since 1.0 25 | */ 26 | package object internal { 27 | } 28 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/model/Collation.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.model 18 | 19 | import com.mongodb.client.model.{Collation => JCollation} 20 | 21 | /** 22 | * The options regarding collation support in MongoDB 3.4+ 23 | * 24 | * @note Requires MongoDB 3.4 or greater 25 | * @since 1.2 26 | */ 27 | object Collation { 28 | 29 | /** 30 | * Creates a builder for creating the Collation. 31 | * 32 | * @return a new Builder for creating the Collation. 33 | */ 34 | def builder(): Builder = JCollation.builder() 35 | 36 | /** 37 | * Collation builder type 38 | */ 39 | type Builder = JCollation.Builder 40 | 41 | } 42 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/model/CollationCaseFirst.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.model 18 | 19 | import scala.util.Try 20 | 21 | import com.mongodb.client.model.{CollationCaseFirst => JCollationCaseFirst} 22 | 23 | /** 24 | * Collation support allows the specific configuration of how character cases are handled. 25 | * 26 | * @note Requires MongoDB 3.4 or greater 27 | * @since 1.2 28 | */ 29 | object CollationCaseFirst { 30 | /** 31 | * Uppercase first 32 | */ 33 | val UPPER: CollationCaseFirst = JCollationCaseFirst.UPPER 34 | 35 | /** 36 | * Lowercase first 37 | */ 38 | val LOWER: CollationCaseFirst = JCollationCaseFirst.LOWER 39 | 40 | /** 41 | * Off 42 | */ 43 | val OFF: CollationCaseFirst = JCollationCaseFirst.OFF 44 | 45 | /** 46 | * Returns the CollationCaseFirst from the string value. 47 | * 48 | * @param collationCaseFirst the string value. 49 | * @return the read concern 50 | */ 51 | def fromString(collationCaseFirst: String): Try[CollationCaseFirst] = Try(JCollationCaseFirst.fromString(collationCaseFirst)) 52 | 53 | } 54 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/model/CollationMaxVariable.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.model 18 | 19 | import scala.util.Try 20 | 21 | import com.mongodb.client.model.{CollationMaxVariable => JCollationMaxVariable} 22 | 23 | /** 24 | * Collation support allows the specific configuration of whether or not spaces and punctuation are considered base characters. 25 | * 26 | * `CollationMaxVariable` controls which characters are affected by [[CollationAlternate$.SHIFTED]]. 27 | * 28 | * @note Requires MongoDB 3.4 or greater 29 | * @since 1.2 30 | */ 31 | object CollationMaxVariable { 32 | /** 33 | * Punct 34 | * 35 | * Both punctuation and spaces are affected. 36 | */ 37 | val PUNCT: CollationMaxVariable = JCollationMaxVariable.PUNCT 38 | 39 | /** 40 | * Shifted 41 | * 42 | * Only spaces are affected. 43 | */ 44 | val SPACE: CollationMaxVariable = JCollationMaxVariable.SPACE 45 | 46 | /** 47 | * Returns the CollationMaxVariable from the string value. 48 | * 49 | * @param collationMaxVariable the string value. 50 | * @return the read concern 51 | */ 52 | def fromString(collationMaxVariable: String): Try[CollationMaxVariable] = Try(JCollationMaxVariable.fromString(collationMaxVariable)) 53 | 54 | } 55 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/model/ReturnDocument.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.model 18 | 19 | import com.mongodb.client.model.{ReturnDocument => JReturnDocument} 20 | 21 | /** 22 | * Indicates which document to return, the original document before change or the document after the change 23 | * 24 | * @since 1.0 25 | */ 26 | object ReturnDocument { 27 | /** 28 | * Indicates to return the document before the update, replacement, or insert occurred. 29 | */ 30 | val BEFORE: JReturnDocument = JReturnDocument.BEFORE 31 | 32 | /** 33 | * Indicates to return the document after the update, replacement, or insert occurred. 34 | */ 35 | val AFTER: JReturnDocument = JReturnDocument.AFTER 36 | } 37 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/model/changestream/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.model 18 | 19 | package object changestream { 20 | 21 | /** 22 | * Represents the `\$changeStream` aggregation output document. 23 | * 24 | * '''Note:''' this class will not be applicable for all change stream outputs. If using custom pipelines that radically change the 25 | * change stream result, then an alternative document format should be used. 26 | * 27 | * @tparam T The type that this collection will encode the `fullDocument` field into. 28 | */ 29 | type ChangeStreamDocument[T] = com.mongodb.client.model.changestream.ChangeStreamDocument[T] 30 | 31 | /** 32 | * Change Stream fullDocument configuration. 33 | */ 34 | type FullDocument = com.mongodb.client.model.changestream.FullDocument 35 | 36 | object F 37 | } 38 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/model/vault/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.model 18 | 19 | import com.mongodb.client.model.vault.{DataKeyOptions => JDataKeyOptions} 20 | import com.mongodb.client.model.vault.{EncryptOptions => JEncryptOptions} 21 | 22 | /** 23 | * This package contains options classes for the key vault API 24 | * 25 | * @since 2.7 26 | */ 27 | package object vault { 28 | 29 | /** 30 | * The options for creating a data key. 31 | */ 32 | type DataKeyOptions = JDataKeyOptions 33 | 34 | object DataKeyOptions { 35 | def apply(): DataKeyOptions = new JDataKeyOptions() 36 | } 37 | 38 | /** 39 | * The options for explicit encryption. 40 | */ 41 | type EncryptOptions = JEncryptOptions 42 | 43 | /** 44 | * The options for explicit encryption. 45 | */ 46 | object EncryptOptions { 47 | 48 | /** 49 | * Construct an instance with the given algorithm. 50 | * 51 | * @param algorithm the encryption algorithm 52 | */ 53 | def apply(algorithm: String): EncryptOptions = new JEncryptOptions(algorithm) 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/result/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | /** 20 | * Result based types 21 | * 22 | * @since 1.0 23 | */ 24 | package object result { 25 | 26 | /** 27 | * The result of a delete operation. If the delete was unacknowledged, then `wasAcknowledged` will return false and all other methods 28 | * with throw an `UnsupportedOperationException`. 29 | */ 30 | type DeleteResult = com.mongodb.client.result.DeleteResult 31 | 32 | /** 33 | * The result of an update operation. If the update was unacknowledged, then `wasAcknowledged` will return false and all other methods 34 | * with throw an `UnsupportedOperationException`. 35 | */ 36 | type UpdateResult = com.mongodb.client.result.UpdateResult 37 | 38 | } 39 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/vault/ClientEncryptions.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ package org.mongodb.scala.vault 16 | 17 | import com.mongodb.ClientEncryptionSettings 18 | import com.mongodb.annotations.Beta 19 | import com.mongodb.async.client.vault.{ClientEncryptions => JClientEncryptions} 20 | 21 | /** 22 | * Factory for ClientEncryption implementations. 23 | * 24 | * @note: support for client-side encryption should be considered as beta. Backwards-breaking changes may be made before the final 25 | * release. 26 | * @since 2.7 27 | */ 28 | @Beta 29 | object ClientEncryptions { 30 | 31 | /** 32 | * Create a key vault with the given options. 33 | * 34 | * @param options the key vault options 35 | * @return the key vault 36 | */ 37 | def create(options: ClientEncryptionSettings): ClientEncryption = ClientEncryption(JClientEncryptions.create(options)) 38 | 39 | } 40 | -------------------------------------------------------------------------------- /driver/src/main/scala/org/mongodb/scala/vault/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ package org.mongodb.scala 16 | 17 | /** 18 | * This package contains the Key Vault API 19 | * 20 | * @note: support for client-side encryption should be considered as beta. Backwards-breaking changes may be made before the final 21 | * release. 22 | * @since 2.7 23 | */ 24 | package object vault { 25 | } 26 | -------------------------------------------------------------------------------- /driver/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /driver/src/test/scala/org/mongodb/scala/internal/OverridableObservableImplicitsSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.internal 18 | 19 | import scala.concurrent.duration.DurationInt 20 | import org.mongodb.scala.Observable 21 | import org.scalatest.{FlatSpec, Matchers} 22 | 23 | import scala.concurrent.ExecutionContext.Implicits.global 24 | import scala.concurrent.{Await, Future} 25 | 26 | object ObservableImplicitOverride { 27 | implicit class ObservableFuture[T](obs: => Observable[T]) { 28 | def toFuture(): Future[String] = Future("Overridden observable") 29 | } 30 | 31 | } 32 | 33 | class OverridableObservableImplicitsSpec extends FlatSpec with Matchers { 34 | 35 | "Observable implicits" should "be overrideable" in { 36 | import ObservableImplicitOverride._ 37 | 38 | val observable: Observable[Int] = Observable(1 to 10) 39 | 40 | Await.result(observable.toFuture(), 1.second) should equal("Overridden observable") 41 | } 42 | 43 | it should "also allow the default implementation to work" in { 44 | import org.mongodb.scala._ 45 | val observable: Observable[Int] = Observable(1 to 10) 46 | 47 | Await.result(observable.toFuture(), 1.second) should equal((1 to 10).toList) 48 | 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /driver/src/test/scala/org/mongodb/scala/model/MapReduceActionSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.model 18 | 19 | import java.lang.reflect.Modifier._ 20 | 21 | import com.mongodb.client.model.{MapReduceAction => JMapReduceAction} 22 | 23 | import org.scalatest.{FlatSpec, Matchers} 24 | 25 | class MapReduceActionSpec extends FlatSpec with Matchers { 26 | 27 | "MapReduceAction" should "mirror com.mongodb.client.model.MapReduceAction" in { 28 | val wrapped = classOf[JMapReduceAction].getEnumConstants.map(_.getValue.toUpperCase).toSet 29 | val local = MapReduceAction.getClass.getDeclaredMethods.filter(f => isPublic(f.getModifiers)).map(_.getName).toSet 30 | 31 | local should equal(wrapped) 32 | } 33 | 34 | it should "have the same values" in { 35 | MapReduceAction.MERGE should equal(JMapReduceAction.MERGE) 36 | 37 | MapReduceAction.REDUCE should equal(JMapReduceAction.REDUCE) 38 | 39 | MapReduceAction.REPLACE should equal(JMapReduceAction.REPLACE) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /driver/src/test/scala/org/mongodb/scala/model/ReturnDocumentSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.model 18 | 19 | import java.lang.reflect.Modifier._ 20 | 21 | import com.mongodb.client.model.{ReturnDocument => JReturnDocument} 22 | 23 | import org.scalatest.{FlatSpec, Matchers} 24 | 25 | class ReturnDocumentSpec extends FlatSpec with Matchers { 26 | 27 | "ReturnDocument" should "mirror com.mongodb.client.model.ReturnDocument" in { 28 | val wrapped = classOf[JReturnDocument].getEnumConstants.map(_.toString).toSet 29 | val local = ReturnDocument.getClass.getDeclaredMethods.filter(f => isPublic(f.getModifiers)).map(_.getName).toSet 30 | 31 | local should equal(wrapped) 32 | } 33 | 34 | it should "have the same values" in { 35 | ReturnDocument.BEFORE should equal(JReturnDocument.BEFORE) 36 | 37 | ReturnDocument.AFTER should equal(JReturnDocument.AFTER) 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /project/Resolvers.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import sbt._ 17 | 18 | object Resolvers { 19 | // Repositories 20 | val sonatypeSnaps = "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" 21 | val sonatypeRels = "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases" 22 | 23 | val typeSafeSnaps = "TypeSafe snapshots" at "http://repo.typesafe.com/typesafe/snapshots" 24 | val typeSafeRels = "TypeSafe releases" at "http://repo.typesafe.com/typesafe/releases" 25 | 26 | val localMaven = "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository" 27 | 28 | val mongoScalaResolvers = Seq(sonatypeSnaps, localMaven, sonatypeRels, typeSafeSnaps, typeSafeRels) 29 | } 30 | -------------------------------------------------------------------------------- /project/Versioning.scala: -------------------------------------------------------------------------------- 1 | import com.typesafe.sbt.SbtGit._ 2 | import sbt._ 3 | 4 | object Versioning { 5 | 6 | val snapshotSuffix = "-SNAPSHOT" 7 | val releasedVersion = """^r?([0-9\.]+)$""".r 8 | val releasedCandidateVersion = """^r?([0-9\.]+-rc\d+)$""".r 9 | val betaVersion = """^r?([0-9\.]+-beta\d+)$""".r 10 | val snapshotVersion = """^r?[0-9\.]+(.*)$""".r 11 | 12 | def settings(baseVersion: String): Seq[Def.Setting[_]] = Seq( 13 | git.baseVersion := baseVersion, 14 | git.uncommittedSignifier := None, 15 | git.useGitDescribe := true, 16 | git.formattedShaVersion := git.gitHeadCommit.value map(sha => s"$baseVersion-${sha take 7}$snapshotSuffix"), 17 | git.gitTagToVersionNumber := { 18 | case releasedVersion(v) => Some(v) 19 | case releasedCandidateVersion(rc) => Some(rc) 20 | case betaVersion(beta) => Some(beta) 21 | case snapshotVersion(v) => Some(s"$baseVersion$v$snapshotSuffix") 22 | case _ => None 23 | } 24 | ) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.16 2 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | 2 | addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.0") 3 | 4 | addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0") 5 | 6 | addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0") 7 | 8 | addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") 9 | 10 | libraryDependencies += "org.scoverage" %% "scalac-scoverage-runtime" % "1.4.1" 11 | 12 | addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") 13 | 14 | addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.2") 15 | 16 | addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") 17 | 18 | addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1") 19 | 20 | libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value 21 | -------------------------------------------------------------------------------- /rootdoc.txt: -------------------------------------------------------------------------------- 1 | This is the documentation for the MongoDB Scala driver. 2 | 3 | == Driver structure == 4 | 5 | The [[http://mongodb.org mongodb]] scala driver. 6 | 7 | To get started you need a [[org.mongodb.scala.MongoClient MongoClient]] instance, either from a 8 | [[http://docs.mongodb.org/manual/reference/connection-string/ connection string]] or via a [[org.mongodb.scala.MongoClientSettings]]. 9 | 10 | Notable packages include: 11 | 12 | - [[org.mongodb.scala.MongoClient MongoClient]] The MongoClient used to connect and access MongoDB 13 | - [[org.mongodb.scala.MongoDatabase MongoDatabase]] Providing access to a specific database 14 | - [[org.mongodb.scala.MongoCollection MongoCollection]] Providing access to a specific collection in a database. 15 | --------------------------------------------------------------------------------