Does anyone know how does MondgoDB works on Android.
Does it work locally and you the data gets replicated later?
Does work only online with just a web backend?
Does anyone know how does MondgoDB works on Android.
Does it work locally and you the data gets replicated later?
Does work only online with just a web backend?
Great new Android application
No Need to root your Phone and You Can Run your js File From anywere.
MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas.
Usage:
1: install Dory mongoDB Server
2: run your Server
3: install Dory node.js
4: run this code in your js file:
Code:
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test', { useMongoClient: true });
mongoose.Promise = global.Promise;
var Cat = mongoose.model('Cat', { name: String });
var kitty = new Cat({ name: 'Zildjian' });
kitty.save(function (err) {
if (err) {
console.log(err);
} else {
console.log('meow');
}
});
Enjoy.
Unfortunately Mongo Java Driver 3.8.0 is not compatible with Android anymore: https://gitlab.com/mvysny/umn/issues/1 and they don't even claim Android support. Maybe following the unofficial fork or trying GnuSasl could help? mongodb 3.x driver Android compatibility
It isn't possible to install MongoDB in android devices because the MongoDB's latest releases doesn't support android device's CPU architecture.
But I read an article on codipher.com and i gave it a try and it finally worked, i was able to use MongoDB on my android phone.
Here is the link: https://codipher.com/install-mongodb-on-android/
MongoDB is also available for android
The only problem is that it does not have well-structured documentation for android..
I recently managed to connect my android application to the remote database
here is a sample unit application https://github.com/i-sachinkumar/MongoDB-for-Android
Its readme file contains all the steps to be followed in the back-end as well as in the android studio
Reactivating this Topic again after 2 years.
I was looking for an android app exactly like MongoDB Compass, but couldn't find "exactly" like it. So deciding to make one (and open source it)
Based on links given in @Astral1990's answer, I found this.
Now for a gist:
Gradle file: (more info here)
implementation 'org.mongodb:mongodb-driver-sync:4.2.3'
For creating the client: (more info here)
MongoClient mongoClient = MongoClients.create("mongodb://user1:pwd1@host1/?authSource=db1");
Then other things:
// get db
MongoDatabase database = mongoClient.getDatabase("test");
// get collection in db
MongoCollection<Document> coll = database.getCollection("myTestCollection");
// list collections (permission has to be present)
for (String name : database.listCollectionNames()) {
System.out.println(name);
}