how to export current app users from mongo realm application? - mongodb

My question is a simple query regarding mongo realm application. How can we export the current app users from mongo realm application.
I am trying to clone an existing mongo realm application
I have successfully exported the mongo atlas db dump as well as the mongo realm application
I have successfully created new mongo realm application and imported all the previous existing setup
I am able to see the users collection in my mongo altas collection but when trying to login with there cred it shows user not exists
Please also note I am using default authentication i.e., "Email/Password"

Related

Mongodbd login with Mongoose to new database

I use mongoDB in Atlas cloud but now I want to movie to a local database. I installed MongoDB and created a admin user. Now I connect with mongoose to :
mongodb://login:pass#db.myserver.com:27017/admin
Works well. Now I create a new development database "develop".
I try to connect
mongodb://login:pass#db.myserver.com:27017/develop
This failed to login. OK, I understand that the admin database is the "/admin" one and that user is authenticated to this database but I thought that an admin can access all databases in a mongodb server?
In Atlas I just created the develop database and connected to it without any problem.
How I can well connect with mongoose to the new develop database? Do I need to create a second admin for this database?
Ok, I found out that I have to name the auth database in my connection string.
mongodb://login:pass#db.myserver.com:27017/develop?authSource=admin

Azure DocumentDB and Meteor Accounts

My Meteor app is connected to a DocumentDB database, I try to create a Meteor Accounts using Accounts.createUser({}) , but I can't login to the user because I have been logged out automatically. and the resume.TokenLogin are not removed from the database.
I try to compare that behavior with the local MongoDB one, I found that in local MongoDB some collections are created: users,
meteor_accounts_loginServiceConfiguration and system.indexes but in the docuementDB just users and meteor_accounts_loginServiceConfiguration are created.
I don't khnow if the problem is related with the collection system.indexes or if I need to add somethings to not been logged out automatically after each authentification !

How does Meteor connect to Mongo?

Very new to Meteor.
I am trying to make a separate worker process that uses the ddp and ddp-login packages to log in to my main Meteor app's Mongo collections over DDP.
It is prompting for credentials.
My questions are:
What are the default credentials Meteor sets up to connect to Mongo?
Where are these located in the Meteor project? Where is the connection string?
How do I change these credentials?
I have been hunting all over my project source and it's still "magical" to me.

how to add a mlab database to mongodb

I installed mongodb and connected to it using my terminal. Everything is fine, but the db is the test one. I created an account in mlab to add a new database, but I don't understand how to do so. I have already created a db user.

MongoDB C# driver WriteConcernException Unauthorized on writes for readOnly=false user

I've been running my application with a readOnly=false admin user for 6 months in development on MongoDB 2.2.2. We're getting closer to launch and I wanted to switch over the user that my application runs under to a user in the application's database only with readOnly=false.
I ran the following script from the robomongo as the admin user.
use MyDB
db.addUser("api", "MyPassword", {"readOnly": false});
I also updated the MongoDB connection string to the following.
<add key="DataServer" value="mongodb://api:MyPassword#localhost:27017/MyDB" />
It created my user correctly and I validated that it is in MyDB and is readOnly=false. However, when I use the MongoDB c# driver 1.8.1 it fails on any writes with a WriteConcernException unauthorized. I am able to read records just fine from the database. Looking at the MongoDB logs it is correctly logging into my DB from my c# application but failing on the write calls.
Using the robomongo shell I was able to successfully auth with the api user and write records into one of the collections in the application's DB. So it's leading me to believe that it's something to do with the c# driver. I've also debugged my application code and validated that the MongoClient's GetServer method is returning a MongoServer that has the correct credentials.
Here's the robomongo shell script I ran to validate the user is able to write to the DB.
use MyDB
db.auth("api","MyPassword");
db.Person.insert({"first_name":"Test","last_name":"User"});
db.Person.find({"first_name":"Test"});
Any help as to why the MongoDB c# 1.8.1 driver connecting to MongoDB 2.2.2 and not being able to write records in a user DB with a readOnly=false user would be greatly appreciated.
I can't really see much wrong with your code. I'd suggest trying the following:
Make sure you're reading the DataServer app setting correctly in your C# code (including the DB name)
Create the user in the admin database and see if that helps:
use admin
db.addUser("api", "MyPassword"); // readonly defaults to false