關於mongoose返回的數據爲空

最近用 node + express + mongoDB 去寫後端接口的時候,發現一個差異的問題:         比如我 DB 裏面寫了個集合叫 alertmsg,當我寫 get 接口的時候,返回的是一個空數組: [] model 如下: 接口路由如下: Google 很久也沒找出答案,明明 DB 裏面已經寫入數據了,單當我試了一下 post 請求時,意外發現 DB 多了一個 collectio
相關文章
相關標籤/搜索