MongoLab syntax error on import command - mongodb

I'm trying to import data into a MongoLab hosted mongo database. I keep getting syntax errors. I've used the tools->Pre-filled commands but it's not working.
Actually when I copy/paste from the Pre-filled example, the % doesn’t show in the command line tool. Should it be a ‘%’ as it shows in the 'helper' or is it an error in html encoding?
I've got no experience with MongoLab nor with MongoDB for that matter. Can anyone advise me about MongoLab as a hosting service for my Mongo db?
Thanks

Related

Error in connector: missing field `info` - Prisma Introspection (npx prisma db pull)

I have created an Express, Apollo GraphQL server which accepts requests and returns data from a MongoDB database via Prisma.
I have tested my application with a simple database from MongoDB Atlas and it all seems to work fine.
Now that I know everything works fine, I want to 'plug in' a MongoDB database which contains a lot of data already, located in my Azure portal (Cosmos DB).
I have changed the database connection string to point to this new database (a read only connection string) and now attempting to use the Introspection feature of Prisma (https://www.prisma.io/docs/getting-started/setup-prisma/add-to-existing-project/mongodb/introspection-typescript-mongodb#introspecting-mongodb-with-prisma).
After running the npx prisma db pull --force command, I get the following error:
I can't figure out if this is an issue with my connection string, or something else.
I have also attempted to use the Read/ Write connection string but that doesn't seem to work either. I get the same error message.
There does not seem to be any information online regarding this error message other than this:
https://www.prisma.io/docs/reference/api-reference/error-reference#prismaclientvalidationerror
But I am unsure if this is at all related, because it seems to relate to creating a new record, rather than anything to do with introspection.

Parse Migration - How to migrate parse data to localhost mongoDB?

I had been trying to migrate my parse data to localhost mongoDB but to no avail. There are a total of 12 steps as mentioned in https://parse.com/migration#database
I am currently still at step 1 and I had encountered some difficulties. I managed to set mongoDB on my computer (localhost). Then I went to my "app settings" in parse to start the data migration. Parse wanted me to paste the mongoDB connection URL which I had entered as "mongodb://localhost/". However, there was an error "no reachable servers". On my localhost, I am running the mongoDB using my terminal.
Any kind advise on this? This is my first time doing data migration and trying out mongoDB. Any help will be greatly appreciated!
Cheers
In your parse dashboard, go to App settings -> General. In this page you can find the "Export app data" button. Click and parse send you an email with the csv database data, use it for import your data in your local database (use rockmongo for example or mongoimport)

'No reachable servers' error when beginning parse migration with MongoDB

I am in the process of migrating my app from Parse to MongoDB and IBM Bluemix, however I can't seem to reach the server when attempting the migration of data from Parse.
I've been following this tutorial tutorial, and I am currently on the step: Migrating data from Parse.com to your MongoDB instance
I am currently getting this error: No reachable servers when clicking 'Begin the migration'.
These are the connection strings in compose:
And I have tried entering various strings. I assumed this would work:
mongodb://username:password#aws-us-east-1-portal.7.dblayer.com:10803/mtcdatabase
But I get the same error. Obviously I'm changing username and password to my own credentials.
Anyone have any suggestions?
The issue ended up being that I was using the latest version of MongoDB, however Parse doesn't seem to support it. Therefore, I had to use MongoDB Classic version 3.0. Everything works great now.

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

GridFS issues with a Mongo Import

I have a production server running Mongo 2.0.7 and a local machine that runs Mongo 2.0.6.
I exported a database as a JS file and then imported it in my local machine. EVerything seems to be working fine however I am unable to server GridFS files. That is when I try accessing that resource, I get corrupt data and thus no image. Any thoughts? I tried looking at the change log for the version change and saw nothing that could effect that?
Thanks
I'm guessing that you used mongoexport to produce the JSON dumps. mongoexport does not provide the same data fidelity as mongodump, so try that instead.