如何使用restanglar、pythoneve将值推送到集合的列表字段到mongodb中
我在前端使用restanglar,在后端使用pythoneve,示例模式如下图所示如何使用restanglar、pythoneve将值推送到集合的列表字段到mongodb中,python,angularjs,mongodb,restangular,eve,Python,Angularjs,Mongodb,Restangular,Eve,我在前端使用restanglar,在后端使用pythoneve,示例模式如下图所示 'notifications': { 'type': 'dict', 'schema': { 'friend_requests': { 'type': 'list', 'schema': { 'type': 'objectid', #'unique': True,
'notifications': {
'type': 'dict',
'schema': {
'friend_requests': {
'type': 'list',
'schema': {
'type': 'objectid',
#'unique': True,
'data_relation': {
'resource': 'people',
'embeddable': True
}
}
},
},
},
我使用以下rest角度前端查询
angular.module('weberApp')
.controller('UserprofileCtrl', function($scope, $routeParams, Restangular,
InfinitePosts, CurrentUser, UserService,FriendsNotific) {
$scope.UserService = UserService;
var user_obj = Restangular.one('people', $routeParams.username);
user_obj.get().then(function(user) {
$scope.user = user;
$scope.addFriend = function() {
$scope.user.patch(
{
"$push": {"notifications":
{
"friend_requests":JSON.parse(CurrentUser.userId)
}
}
}
).then(function(data){
console.log(data)
});
};
});
});
但上面查询返回状态“ok”。但是没有更新任何东西。
如果有人知道,请帮助我