我在这里使用promised-mongo。虽然查询其工作正常,但特定数据不会从数据库中删除。任何人都可以帮助我吗?
const Mutation = new GraphQLObjectType({
name: "Mutations",
fields: {
deleteDonor: {
type: Donor,
args: {
_id: { type: GraphQLString }
},
resolve: function(rootValue, args) {
let donor = Object.assign({}, args);
return donorsCollection.remove({_id:donor._id})
.then(_ => donor);
}
}
}
});