https://docs.strongloop.com/display/public/LB/AngularJS+JavaScript+SDK#AngularJSJavaScriptSDK-Read(querying) https://docs.strongloop.com/display/public/LB/Where+filter
Project.find().$promise.then(function(data){
console.log(data)
})
User.me().$promise.then(function (userData) {
Project.create({
userId: userData.profile.id,
name: 'test2',
meta: {
name: 'test2',
description: 'test2 description',
title: 'test2title',
}
}).$promise.then(function(data){
console.log(data)
})
})
Project.find({
filter: {
where: {
name: 'test2'
}
}
}).$promise.then(function(data){
console.log(data)
})
$scope.project = Project.findOne({
filter: {
where: {
name: 'test2'
}
}
}).$promise.then(function(data){
self.theProject = data
})
$scope.saveme = function(d){
d.name = 'test3';
d.$save();
}
Project.upsert({
"id" : "55dad5a30cd982ba6401b051",
"name" : "test3",
"meta" : {
"name" : "test2",
"description" : "Add a description to test2 project",
"email" : "[email protected]",
"owner" : "github.toroio-client"
}
}).$promise.then(function(data){
console.log(data)
})
//<button name="thebutton" ng-click="saveme(coderProjectsList.theProject)">The Button</button>
Project.deleteById({ id: '55dbb8a9d3033fdc5d6610d6' })
.$promise
.then(function() { console.log('deleted'); });