├── .meteor ├── .finished-upgraders ├── .gitignore ├── .id ├── packages ├── platforms ├── release └── versions ├── README.md ├── think.css ├── think.html └── think.js /.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | -------------------------------------------------------------------------------- /.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | 1pheptz1k27bgkdl8og7 8 | -------------------------------------------------------------------------------- /.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-platform 8 | insecure 9 | simple:rethink 10 | -------------------------------------------------------------------------------- /.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@1.1.0.2 2 | -------------------------------------------------------------------------------- /.meteor/versions: -------------------------------------------------------------------------------- 1 | autoupdate@1.2.1 2 | base64@1.0.3 3 | binary-heap@1.0.3 4 | blaze@2.1.2 5 | blaze-tools@1.0.3 6 | boilerplate-generator@1.0.3 7 | callback-hook@1.0.3 8 | check@1.0.5 9 | ddp@1.1.0 10 | deps@1.0.7 11 | ejson@1.0.6 12 | fastclick@1.0.3 13 | geojson-utils@1.0.3 14 | html-tools@1.0.4 15 | htmljs@1.0.4 16 | http@1.1.0 17 | id-map@1.0.3 18 | insecure@1.0.3 19 | jquery@1.11.3_2 20 | json@1.0.3 21 | launch-screen@1.0.2 22 | livedata@1.0.13 23 | logging@1.0.7 24 | meteor@1.1.6 25 | meteor-platform@1.2.2 26 | minifiers@1.1.5 27 | minimongo@1.0.8 28 | mobile-status-bar@1.0.3 29 | mongo@1.1.0 30 | observe-sequence@1.0.6 31 | ordered-dict@1.0.3 32 | random@1.0.3 33 | reactive-dict@1.1.0 34 | reactive-var@1.0.5 35 | reload@1.1.3 36 | retry@1.0.3 37 | routepolicy@1.0.5 38 | session@1.1.0 39 | simple:rethink@0.0.1 40 | spacebars@1.0.6 41 | spacebars-compiler@1.0.6 42 | templating@1.1.1 43 | tracker@1.0.7 44 | ui@1.0.6 45 | underscore@1.0.3 46 | url@1.0.4 47 | webapp@1.2.0 48 | webapp-hashing@1.0.3 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Before running, [create a table](https://github.com/Slava/meteor-rethinkdb#tables) named `cities`. 2 | -------------------------------------------------------------------------------- /think.css: -------------------------------------------------------------------------------- 1 | /* CSS declarations go here */ 2 | -------------------------------------------------------------------------------- /think.html: -------------------------------------------------------------------------------- 1 | 2 | think 3 | 4 | 5 | 6 |

Rethought Cities

7 | 8 | {{> hello}} 9 | 10 | 11 | 33 | 34 | 37 | -------------------------------------------------------------------------------- /think.js: -------------------------------------------------------------------------------- 1 | Cities = new Rethink.Table('cities'); 2 | r = Rethink.r; 3 | 4 | if (Meteor.isClient) { 5 | Meteor.subscribe('data'); 6 | 7 | Template.hello.helpers({ 8 | cities: function () { 9 | return Cities.run(); 10 | }, 11 | 12 | sortedCities: function () { 13 | // r.desc isn't yet supported by reqlite, so: 14 | // Cities.orderBy(r.desc('population')).run() 15 | // doesn't work on the client. 16 | 17 | var ascending = _.sortBy(Cities.fetch(), 'population'); 18 | return ascending.reverse(); 19 | }, 20 | 21 | citiesIn: function (country) { 22 | return Cities.filter({country: country}).run(); 23 | } 24 | }); 25 | } 26 | 27 | if (Meteor.isServer) { 28 | if (Cities.count().run() === 0) { 29 | Cities.insert([{ 30 | name: 'Wenzhou', 31 | population: 3039439, 32 | country: 'China' 33 | }, { 34 | name: 'Addis Ababa', 35 | population: 3103673, 36 | country: 'Ethiopia' 37 | }, { 38 | name: 'Ürümqi', 39 | population: 3112559, 40 | country: 'China' 41 | }, { 42 | name: 'Shanghai', 43 | population: 24150000, 44 | country: 'China' 45 | }, { 46 | name: 'Karachi', 47 | population: 20000000, 48 | country: 'Pakistan' 49 | }]).run(); 50 | } 51 | 52 | Meteor.publish("data", function () { 53 | return Cities.orderBy({ index: 'id' }).limit(100); 54 | }); 55 | } 56 | --------------------------------------------------------------------------------