第一次使用mongodb。 我在服务器端使用node.js和mongojs。有点困惑。 db.save的逆转是找到了,我希望能够做类似的东西:MongoDB保存集合类型 - 另一种方式?
db.furni.find(db.furni_types.chair, db.furni_types.chair.plastic);
当前设置:
// Chair types
db.furni_types.save({ type: "chair", material: "wood" });
db.furni_types.save({ type: "chair", material: "plastic" });
db.furni_types.save({ type: "chair", material: "beanbag" });
// other furni types
db.furni_types.save({ type: "bed", material: "silk" });
db.furni_types.save({ type: "table", effect: "glass" });
db.furni.save({id: "13626450", name: "ComfyMan", type: "chair", material: "wood", description: "The most comfortable chair in extistence."});
几个问题:
上午我去正确的方式或什么?
在db.furni.save(type:“chair”,material:“wood”)中找到的数组是否足够,如果我想稍后使用它们作为对象?
如果我想要做这样的事情:
db.furni.save(name: "Super Comfort", db.furni_types.chair, db.furni_types.chair.wood);
将在上述工作?
db.furni.find(type:“chair”,material:“plastic”)''有什么问题? – 2013-03-08 20:23:45