find返回空数组,而findOne返回null。这两种情况下的err在null中也是如此。这是我的连接: mongoose.connect("mongodb://localhost/test"); //i have also tried127.0.0.1 db.on("error", console.error.bind(con
现在,我的工作是只检索不是由登录用户发布的帖子。以下是前端的axios请求: //Get user token const token = this.props.location.state.token;然后,我将id传递给我的getPosts函数,该函数在后端向此路由发出get请求: // GET POSTS FROM OTHER USERS
router.get('/all/:id