Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
Why no result of db.database.find() although data is there in mongodb?

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.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

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()

See Working with the mongo Shell

over 4 years ago · Santiago Trujillo Denunciar

0

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()

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda