Tutorial by Examples: c

curl -XPUT 'www.example.com:9200/myIndexName?pretty' Output: { "acknowledged" : true } Reference Link: Here
curl 'www.example.com:9200/_cat/indices?v' output: health status index pri rep docs.count docs.deleted store.size pri.store.size green open logstash-2016.07.21 5 1 4760 0 4.8mb 2.4mb green open logstash-2016.07.20 5 1 7232 ...
Let's say there's a collection called Todos and the autopublish package is added. Here is the basic component. import { createContainer } from 'meteor/react-meteor-data'; import React, { Component, PropTypes } from 'react'; import Todos from '/imports/collections/Todos'; export class List exte...
If your application is going to run on different devices, it's going to need to render to different ViewPorts, based on the device size. You can deal with this in two ways: with javascript rules, or CSS media styles. If you've been using a MVC or MVVM library, such as Angular or Ember (or Blaze, for...
To get all of this to work, you'll probably need offline support, which means caching application data and user data. meteor add appcache meteor add grounddb
On desktop apps, you may want to disable scroll-bounce, to give your app a more native feel. You can do this with javascript, by disabling how the browser controls the DOM: // prevent scrolling on the whole page // this is not meteorish; TODO: translate to meteor-centric code document.ontouchmove...
Mobile devices generally don't have keyboards, so you'll need to add some haptic controllers to your application. The two popular packages that people seem to be using is FastClick and Hammer. Installation is easy. meteor add fastclick meteor add hammer:hammer FastClick requires nearly no confi...
Before you compile your app and run it on your device, you'll need create some icons and splash screens, and add a mobile-config.js file to your app. App.icons({ // iOS 'iphone': 'resources/icons/icon-60x60.png', 'iphone_2x': 'resources/icons/[email protected]', 'ipad': 'resources/icons...
Now it's time to go through the Meteor Cordova Phonegap Integration documentation. Since that documentation was written, XCode and Yosemite have been released, which has caused some hiccups in installation. Here are the steps we had to go through to get Meteor compiled to an iOS device. Upgrade ...
Make sure your development workstation and iPhone are connected to the same WiFi network. Tethering, hotspots, and other ad-hoc networking won't work. Run sudo meteor run ios-device Deploy to your device!
You'll need to separate out your application layer from your database layer, and that means specifying the MONGO_URL. Which means running your app through the bundle command, uncompressing it, setting environment variables, and then launching the project as a node app. Here's how... #make sure you...
Then go into the mongo shell and initiate the replica set, like so: mongo > rs.initiate() PRIMARY> rs.add("mongo-a") PRIMARY> rs.add("mongo-b") PRIMARY> rs.add("mongo-c") PRIMARY> rs.setReadPref('secondaryPreferred')
The replica set will need an oplog user to access the database. mongo PRIMARY> use admin PRIMARY> db.addUser({user:"oplogger",pwd:"YOUR_PASSWORD",roles:[],otherDBRoles:{local:["read"]}}); PRIMARY> show users
Your upstart script will need to be modified to use multiple IP addresses of the replica set. start on started mountall stop on shutdown respawn respawn limit 99 5 script # our example assumes you're using a replica set and/or oplog integreation export MONGO_URL='mongodb://mongo-a...
The --url flag can be tricky to use. There is a 60 second window to authenticate, and then the username/password randomly resets. So be sure to have robomongo open and ready to configure a new connection when you run the command. # get the MONGO_URL string for your app meteor mongo --url $METEOR...
Same thing as before, but you have to copy the info into the mongodump command. You have to run the following commands rediculously fast, and it requires hand/eye coordination. Be warned! This is a rediculously hacky! But fun! Think of it as a video game! :D # get the MONGO_URL string for your app ...
This command will create a /dump directory, and store each collection in a separate BSON blob file. This is the best way to backup or transfer databases between systems. mongodump --db meteor
Run meteor, open another terminal window, and run the following command. mongoexport --db meteor --collection foo --port 3001 --out foo.json
Mongo supports database-to-database copying, which is useful if you have large databases on a staging database that you want to copy into a local development instance. // run mongod so we can create a staging database // note that this is a separate instance from the meteor mongo and minimongo ins...
Preallocation. Mongo sets aside disk-space in empty containers, so when the time comes to write something to disk, it doesn't have to shuffle bits out of the way first. It does so by a doubling algorithm, always doubling the amount of disk space preallocated until it reaches 2GB; and then each preal...

Page 305 of 826