A
A
Alexander Bagirov2016-03-20 14:08:25
MongoDB
Alexander Bagirov, 2016-03-20 14:08:25

How to see the structure of a mongodb collection?

Hello.
There is a collection in mongodb. How to view its "fields", that is, the columns of this "table"?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Bagirov, 2016-03-20
@alexbagirov

This is done using
db.collectionName.findOne()

A
Anton Ratnik, 2016-03-20
@Ratnick

If your project uses mogoose, you can look for a file with mongoose schema. You can use the robomongo
interface for even more clarity, for example , or simply print the entire collection to the console.

E
Eugene, 2016-03-20
@Nc_Soft

No way. There is no data scheme, in each document anything can be stuffed up.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question