https://github.com/dcavar/mongodbjava
Example implementation for connecting MongoDB with Java
https://github.com/dcavar/mongodbjava
java mongodb
Last synced: 3 months ago
JSON representation
Example implementation for connecting MongoDB with Java
- Host: GitHub
- URL: https://github.com/dcavar/mongodbjava
- Owner: dcavar
- License: apache-2.0
- Created: 2018-08-11T23:10:37.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-11T23:31:12.000Z (almost 8 years ago)
- Last Synced: 2026-04-08T22:04:08.167Z (4 months ago)
- Topics: java, mongodb
- Language: Java
- Homepage: http://damir.cavar.me/
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mongoDBJava
(C) 2018 by [Damir Cavar](http://damir.cavar.me/)
This is a simple example of connecting to MongoDB and querying some data from some
database.
This is tested with Java 10, the latest MongoDB release, etc.
Set up the database name, collection, and column label, compile and run.
To build:
mvn compile package
To run the jar-file in the target folder with some command line parameters (strings
to query in the MongoDB database):
java -jar target/mongoDBQuery-1.0-SNAPSHOT.jar cats dogs
I use this to query word embeddings (word2vec vectors), keywords from knowledge graphs
or ontologies, and so on.
The MongoDB library kept on changing in the past. This code should work with the latest release.