I have imported data into mongodb from csv files which has a million records using mongoimport utility:
show dbs;
admin 0.000GB
ded 0.305GB
local 0.000GB
visitors 0.000GB
db.ded.find();
Why is there no rows in the ded database when there is data of 0.305GB? How can I see this data? Any inputs on this would be great help.
find() does not return any document because you are using the test database which does not have collection named ded.
By default, MongoDB connects to the test database and from the output of show dbs, it clear that ded is a database. To query the documents in the collections in that database, you first need to switch to it using:
use ded
Then show collections to list the collections in that database.
Also note that after switching, db is the instance of your database (here ded) so you will be querying your collection like this:
db.collectionname.find()
So if your collection's name is "flights",
db.flights.find()
You can use this utility (http://3t.io/mongochef/) it is easy to use and helpful for those who are new to Mongodb. While the answer to your question is the record is not showing through database name.First write db.printCollectionStats() which gives you the collection name. then use the collection name to show the data. Example db.printCollectionStats() will give you xyz then write db.xyz.find()