试图了解 MongoDB,
此查询不会向 db 中插入任何内容:
> names = ['Serg', 'Bob', 'Sean', 'Sophia'];
[ "Serg", "Bob", "Sean", "Sophia" ]
> for (i=0; i<names.lenght; i++) db.people.insert({ name: names[i], age: Math.round(Math.random()*60) });
> db.people.find()
>
试图了解 MongoDB,
此查询不会向 db 中插入任何内容:
> names = ['Serg', 'Bob', 'Sean', 'Sophia'];
[ "Serg", "Bob", "Sean", "Sophia" ]
> for (i=0; i<names.lenght; i++) db.people.insert({ name: names[i], age: Math.round(Math.random()*60) });
> db.people.find()
>