Where does MongoDB store its documents?

前端 未结 2 1564
隐瞒了意图╮
隐瞒了意图╮ 2021-02-03 23:11

I have inserted and fetched data using MongoDB, in PHP. Is there an actual copy of this data in a document somewhere?

2条回答
  •  猫巷女王i
    2021-02-03 23:18

    MongoDB stores it's data in the data directory specified by --dbpath. It uses a database format so it's not actual documents, but there are multiple documents in each file and you cannot easily extract the data from this format yourself.

    To read and/or update a document you need to use a MongoDB client, in the same way that you send SQL queries to MySQL through a MySQL client. You probably want to do it programmatically by using one of the client libraries for your programming language, but there is also a command-line client if you need to do manual updates.

提交回复
热议问题