Answers
DBRef方式关联,例:
表一one,表二two,
db.one.insert({name:"飞狐"})
o = db.one.find({name:"飞狐"})[0]
db.two.insert({"title":"关联one"},one:[new DBRef('one',o._id)])
db.two.find({title:"Hello China!"})[0].one[0].fetch()
用skip,limit来分页查询,例:
db.two.find().sort({"name":1}).skip(10).limit(10);
网上资料很多,关键的就是DBRef,sort,skip,limit!
战场原灰原哀
answered 9 years, 1 month ago