MongoDB data basic operations

 

 

>use mydb //Open or create a new database
>student1={"name":"yanlei","age":35}//Define object
>db.students.insert(student1)//Insert data in the students collection
>db.students.find()//Query all data in the students collection
>db.students.find({"age":35})//Query the students collection by condition (age==35)

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326853610&siteId=291194637