在我的应用中,我使用mongoose discriminators。我有一个用户表格和一个公司表格。两者都使用所谓的基本方案中的5个相同字段。所以他们都走同一条路。但是在我的公司注册中,电话号码未保存在Mongo中。
我使用Postman在Windows 10机器上测试我的字段。
db.base.find()
//company
{ "_id" : ObjectId("5bafb0e70c6eea3fb8256aa6"), "firstName" : "tina", "lastName" : "tipie", "userName" : "bedrijftichelaar@ziggo.nl", "password" : "$2b$10$E4SlixRfGnnNFpxyeBU7f.En1ptnjmJ4D29.1IOg2elDz0RRLqRgq", "companyName" : "Niek BV", "address" : "Uiterwaardenstraat 14", "postcode" : "1234xx", "companyURL" : "www.niekbv.nl", "kvkNr" : "1234", "Kind" : "Company", "isVerified" : false, "__v" : 0 }
//user
{ "_id" : ObjectId("5bafb25d0c6eea3fb8256aa8"), "firstName" : "Peter", "lastName" : "Tichelaar", "userName" : "tichelaarpeter@gmail.com", "telephone" : "06123", "password" : "$2b$10$0vfYrRNETbvn/aBYK3tJBOewKdi44esqWQD/IBFzW23dFxNFYBVVC", "Kind" : "User", "isVerified" : false, "__v" : 0 }
这听起来有点DIY,但2周前我的注册控制器运行正常。有人有主意吗?