简体   繁体   中英

how to store array of data without knowing the fields?

I am currently developing a Facebook application that calls upon the API and retrieve the user's info and display them on the front end.

However, since there are so many fields in the data. Could i actually store them into an array without knowing the fields using MongoDB?

Data in MongoDB has a flexible schema. Unlike SQL databases, where you must determine and declare a table's schema before inserting data, MongoDB's collections do not enforce document structure.

Read this articel: Data Modeling Introduction

Instead of inserting data to array you can insert it as a new key-value pair to document.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM