Besides using _ID to do searching, you can also use other fields or multiple fields to do searching. For example: Examples JavaScript Codes By username db.collection(“comments”).find( {username: “Peter”} , {limit: 1000}).asArray() It will search all comments with username = “Peter” By Date db.collection(“comments”).find( { date: “01/01/2018”} , {limit: 1000}).asArray() It
After the simple CRUD sample, we will show you the bulk operations from this sample, please click on this URL to play with Blogs CRUD sample. Please see the below bulk operations with related JavaScript codes: Features JavaScript Codes Bulk Insert db.collection(“comments”).insertMany( [ { owner_id : client.auth.user.id, date: “01/01/2018”, username: “Peter”,
We will use stitch.js to build up the CRUD sample, it is provided by MongoDB.Stitch. Please login MongoDB.stitch to play with Users CRUD sample. On this sample page, you can: Connect to the database List all users from collection Get total count from collection Add a new user Find a user by _ID Update a
Login https://cloud.mongodb.com/user#/atlas/login with your registered account, select “Stitch Apps” on the left menu. Click “Create New Application” to create a new application, input “it-blogs” into Application Name, and then click “Create” button to create. After a few minutes, it will create the new application, and show you: On the is page, you can find “Turn
This blog will introduce you what is MongoDB Atlas, and show you how to make use of stitch.js to build a simple CRUD web application step by step. You may refer to these two demo URLs: Users CRUD page Blogs CRUD page After going through our examples, you should have a brief understanding on MongoDB,
This example will show you how to post data to Restful server by using $http.post() in order to demonstrate login and logout functions. Besides, it will use window.localStorage to store the login information. Please follow below steps: Update C:\workspace_ionic\itBlogsApp\www\templates\menu.html by changing: <ion-item menu-close ng-click=”login()”>Login</ion-item> to <ion-item menu-close ng-click=”login()”>{{loginout}}</ion-item> Update C:\workspace_ionic\itBlogsApp\www\templates\login.html by changing: <h1 class=”title”>Login</h1>
This example will show you how to push notification to your IONIC app. Please make sure you have chosen “Y” when creating the app: Make sure you have signup the IONIC account, and you should be able to login https://apps.ionic.io/ : After sign-up the account, please follow the below steps: npm install –g bower ionic
For this example, we will show you how to list the records in table format with header sorting and keyword auto-complete searching functions. Please follow below steps: Update C:\workspace_ionic\itBlogsApp\www\js\app.js , add below code after .state(‘app.shop’ .state(‘app.productlists’, { url: ‘/productlists’, views: { ‘menuContent’: { templateUrl: ‘templates/productlists.html’, controller: ‘ProductListsController’ } } })
After the first example, you know how to $http.get() data from Restful server. This example will show you how to list your records in listing format and show with Google Map. Please follow below steps: Under C:\workspace_ionic\itBlogsApp\www\index.html , add: <!– Google map js –> <script src=”http://maps.googleapis.com/maps/api/js”></script> after <!– cordova script (this will be a 404
This example will show you how to get JSON data from Restful server by using $http.get(), you can download the ionic workspace here. Let’s create a new app by “ionic start itBlogsApp sidemenu” under C:/workspace_ionic/ , it will generate the new project – itBlogsApp. Enter “Y” to create the ionic.io account and please register, because we