刚学mongo 不知道改怎么处理这个需求比较恰当:
每个用户都有个前缀 来建立很多collection 名字类似于这样: user1_abcd 有N个用户 每个用户也有N个collection 我想列出某个用户所有的collection mongo并没有单独的一个接口能实现 而是用获得所有collection然后遍历来判断 这样我看来效率非常低
想请教高手看看有没有更有效率的办法?
学习是最好的投资!
What is the requirement to create multiple collections for each user?.?
Why can’t we change the unfortunate structure of usr1a usr1b usr1c usr2a usr2b usr2c to...
A b c Each of the three collections stores a copy of usr1 and usr2 data...?
What is the requirement to create multiple collections for each user?.?
Why can’t we change the unfortunate structure of usr1a usr1b usr1c usr2a usr2b usr2c to...
A b c Each of the three collections stores a copy of usr1 and usr2 data...?