Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tcelik
Created April 12, 2019 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcelik/2e081a151c6db1251a62cd0e614b8e41 to your computer and use it in GitHub Desktop.
Save tcelik/2e081a151c6db1251a62cd0e614b8e41 to your computer and use it in GitHub Desktop.
MongoDB ATLAS Connection
MongoClientURI uri = new MongoClientURI(
"mongodb+srv://tugberk:<pass>@couples-list-chvsn.mongodb.net/test?retryWrites=true");
MongoClient mongoClient = new MongoClient(uri);
MongoDatabase database = mongoClient.getDatabase("wishdb");
for (var document : database.getCollection("wishs").find())
System.out.println(document.get("todo"));
@tcelik
Copy link
Author

tcelik commented Apr 12, 2019

orm yok, yani ben nesne verim o kaydetsin yok doğrudan insert document istiyor.

Çözüm: Spring boot kullan. Orm'yi bizim yerimize yapsın.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment