为什么插入不是这里的功能?

时间:2018-01-20 22:31:27

标签: mongodb insert

dnp.js:5未捕获TypeError:db.collection(...)。insert不是函数     在addBusiness(dnp.js:5)

function addBusiness() {
db.collection("businesses").insert({owner_id : client.authedId(), 
                                     city: "mycity", 
                                     county: "mycounty", 
                                     name: "mybusiness", 
                                     state: "myState",
                                     street: "mystreet",
                                     zip: "myzip"});

}

0 个答案:

没有答案