3 ms·
This is a great writeup and helps tremendously, thank you! Now, wrt specifics. > the find-and-modify command This has been baked into ReQL from day one and do
by coffeemug 13y ago
This is a great writeup and helps tremendously, thank you! Now, wrt specifics.
> the find-and-modify command
This has been baked into ReQL from day one and doesn't require a special command. Here's an example:
# 'jobs' table contains documents of the form
# { type: 'type', jobs: ['job1', 'job2'] }
r.table('jobs').filter({type: 'printer'}).update(function(row) {
return r.branch(
row('jobs').contains('job1'), // if there is job1 in the array
{jobs: row('jobs').difference(['job1'])}, // atomically remove job1
null // else don't modify the object
);
})
This isn't limited to arrays -- you can do all sorts of atomic find and modify this way within a single document. We clearly need to do a better job documenting this. I'll make sure that happens.
> Packaged linux/mac Rethink binaries
That's been available for a while -- http://rethinkdb.com/docs/install/ http://rethinkdb.com/docs/install/, you can download a binary pkg for OS X if you don't want to use brew, and we support apt-get on ubuntu/debian via a private PPA. We'll be adding binary packages for more distros soon.
> binary storage format
Mongo wins on this one, but it's definitely on the horizon -- https://github.com/rethinkdb/rethinkdb/issues/137 https://github.com/rethinkdb/rethinkdb/issues/137. The storage engine bits for this have been done for a long time, we just have to figure out a sane ReQL API (which is harder than it seems).
> Query optimizer
This is a somewhat longer-term project (i.e. we probably won't get to it by mid-fall), but we're definitely thinking about it. So far though, there hasn't been a real use case yet where it's a problem.
- JulianMorrison 13y agoReQL for binary suggestion: take binary input in the form of a no-args generator function (called repeatedly, returns a series of binary blobs and then null as EOF) or where the language permits, allow a language specific abstraction of a read-once stream such as an IO in Ruby as a higher level wrapper for that. Return binary data in the same form.
- coffeemug 13y agoThanks, this is cool. I posted this suggestion as a comment on the issue (https://github.com/rethinkdb/rethinkdb/issues/137 https://github.com/rethinkdb/rethinkdb/issues/137).