Giter VIP home page Giter VIP logo

rethink-livedata's Introduction

RethinkDB for Meteor [currently broken]

Meteor Smart Package providing RethinkDB support for Meteor

  • Write wonderful ReQL syntax on both client (Minirethink) and server (RethinkDB) side
  • Perform queries faster* by avoiding database polling and the LiveResultsSet
  • Don't write Mongo syntax (again, ever.)

Installation

Install RethinkDB from Atmosphere

    $mrt add rethink-live-data

Install From Git (If you are not using Meteorite)

    mkdir -p packages
    git submodule add https://github.com/tuhinc/rethink-livedata.git packages/rethink-livedata

Usage

Tables

Replace Meteor.Collection with Meteor.Table.

// old code
Posts = new Meteor.Collection('posts');

// with rethink-live-data
Posts = new Meteor.Table('posts');

On the client side, create an instance of Minirethink to use ReQL syntax instead of Mongo syntax.

// instantiate Minirethink
var r = new Minirethink();

// interact with database using ReQL syntax
r.table('posts').get('username').run(callback);

Continue to use publish and subscribe as you normally would. (rethink-live-data does not currently support autopublish)

// server: publish the posts table.
Meteor.publish('posts', function () {
return r.table('posts').run(callback);
});

// client: subscribe to the posts table
Meteor.subscribe('posts');

// client will queue incoming post records until ...
Posts = new Meteor.Table('posts');

Cursors

Currently provides support for each, map, fetch, count, and hasNext

each

Lazily iterate over the result set one element at a time.

cursor.each(callback[, onFinished])

map

Transform each element of the sequence by applying the given mapping function.

cursor.map(mappingFunction)  array

fetch

Returns an array of all documents in the cursor

cursor.fetch()  array    

count

Transform each element of the sequence by applying the given mapping function.

cursor.count()  integer

hasNext

Check if there are more elements in the cursor

cursor.hasNext()  bool

Compatibility

  • Currently does not support autopublish -- publish and subscribe functions must be used!

Scalability

Disclaimers:

  1. This is a work-in-progress. Full functionality has not yet been implemented. There are definitely bugs! :)
    • this claim has not been tested

rethink-livedata's People

Contributors

hackreactor-students avatar tuhinc avatar ulexus avatar

Stargazers

 avatar Ally Jr  avatar Angus H. avatar Bohyung kim avatar EM avatar Bob Davies avatar Yanis Ikene avatar Radoslav Kirilov avatar Hamza Mousa avatar Bozhao avatar Martin Eboh avatar Dusan Blagojevic avatar Loren ☺️ avatar Frank de Groot - Schouten avatar Dauren Akilbekov avatar Samuel Bishop avatar Pantelis Koukousoulas avatar Tim Heckel avatar David Jurelius avatar Bazyli Brzóska avatar Charlie Mantle avatar Hung avatar Omar Duarte avatar Logan Koester avatar David Furlong avatar Alex Pletnov avatar Alec Jacobs avatar Fritz Blueford avatar Sébastien Arnaud avatar  avatar Mark Shropshire avatar Guido avatar Etienne Laurin avatar Jules avatar Paul Meserve avatar Jason Brown avatar Justin Foley avatar Arturas Lebedevas avatar Arpit Jalan avatar Scott Anderson avatar Christopher Ogden avatar Codedaiquiri avatar Brandon Titus avatar Bernhard Millauer avatar Howard Tang avatar Florent Hernandez avatar Pieter Soudan avatar Duma avatar Michael Arthur avatar Michael Hart avatar Michael Glukhovsky avatar Yonggao Pan avatar Chris Sita avatar Yönet avatar Kyle Finley avatar  avatar PatrickJS avatar Chris Lee avatar Ryan Yeske avatar Michael Risse avatar Max Cantor avatar

Watchers

Logan Koester avatar Sergey Petrov avatar Chris Lee avatar Yuki Kumazawa avatar Pieter Soudan avatar Max Cantor avatar Etienne Laurin avatar James Cloos avatar  avatar Yamini avatar  avatar Samuel Bishop avatar Martin Eboh avatar Burtleton avatar

rethink-livedata's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.