别拦我!别拦我!别拦我!
我要给大家分享个bug!!!
情况是这样的,一个Node.js+MongoDB的项目中,使用了mongoose操作数据库,在使用populate()方法进行类似表关联操作的时候,报错如下:
Schema hasn't been registered for model "..."
数据库连接和业务逻辑排了了一整遍,没有问题,但只要使用populate()方法就报错。
老孙翻遍了Google上搜出来的所有相关问题的技术文档,没找到合适的方法。
由于项目已经能写了不少功能,遂单独写了个demo,测试没问题。
中间过程就不详述了,反正反复测试了N多次,最终找到了问题。
表关联的时候我们在Schema数据骨架中需要用ref属性定义关联集合,问题就出在这里!!!!!
这个属性的值不能有大写!必!须!小!写!!!


![神坑react native之ScrollView child layout (["alignitems", "justifyContent"]) must be applied through the contentContainerStyle prop](https://www.sunqizheng.com/wp-content/uploads/2017/12/33.jpg)

![phpstudy启动报错nginx: [emerg] invalid number of arguments in "include" directive in 的解决方法](https://www.sunqizheng.com/wp-content/uploads/2024/09/Snipaste_2024-09-04_10-47-27.jpg)
