Questions tagged [rethinkdb-javascript]

JavaScript driver for RethinkDB

JavaScript driver for RethinkDB.

197 questions
1
vote
1 answer

RethinkDB, add elements to an array that's nested

Using the example here, I've only added one more level to notes, it's mapped to an object whose elements themselves hold arrays { id: 10001, name: "Bob Smith", notes: { alpha:['note1','note2','note3'], …
House3272
  • 1,007
  • 5
  • 14
  • 29
1
vote
1 answer

How to structure an efficient GeoLocation and Time query

Hey rethinkers! i've got a query optimization question that i cant quite figure out. It deals with geoLocation and time. I've got a ton of events, that all have a startTime, endTime (indexed), and location (indexed). If i want to get the events that…
Russell Maxfield
  • 968
  • 7
  • 14
1
vote
1 answer

REthinkdb table is not showing in the interface

I have a rethinkdb with databse wich is contain near about 250 database each database contain 7 table. The current size of data is nearly 11gb. The problem is from the admin interface i am unable to see the database and tables. it gives me error…
1
vote
2 answers

Querying a compound multi-index in RethinkDB

I am trying to efficiently retrieve data that is in the following format: { "datetime": "1453845345493", "someIds": ["id2000-4", "id1000-34", "id2000-43", "id250-34"] } Specifically, what I want to do is "find all records that have happened…
Brideau
  • 4,564
  • 4
  • 24
  • 33
1
vote
1 answer

Query nested field with index support

Can anyone tell me is there a way to query nested field with index support. I created nested index like: r.table('comments').indexCreate('authorName', r.row("author")("name")).run(conn, callback) but I can't see any ways to query all comments…
B. Orlov
  • 23
  • 1
  • 2
1
vote
2 answers

How to get data from Rethinkdb table based on field name instead of field value

I have a rethinkdb table which have 5 rows, one of the row is following: { "appkey": { "YcJ1HR6vjebXNHwOzeC2l2EAvUNw8qyp": { "createdBy": { "fullName": "DD" , "id": "7943d176-4805-461d-841e-3de766a3825d" , "primaryName": dd@gmail.com, » }…
Dinesh Nagar
  • 768
  • 2
  • 11
  • 23
1
vote
1 answer

RethinkDB listen for changes on filter query?

I'm not sure if I fully understand the changefeeds correct... What I need to do is filter data based on current date like this: r.table("messages") .filter( r.row("start").lt(r.now().toISO8601()) …
mk-conn
  • 11
  • 3
1
vote
1 answer

Rethinkdb multiple level grouping

Let's say I have a table with documents like: { "country": 1, "merchant": 2 "product": 123, ... } Is it possible to group all the documents into a final json structure like: [ { : { : { …
DevLounge
  • 8,313
  • 3
  • 31
  • 44
1
vote
0 answers

Do I need to clean up cursor resources when subscribing to changes with the rethinkdb javascript driver?

When susbscribing to changefeeds, do I need to clean up or close cursors when they should go out of scope to manage resources/connections/etc.?? socketIo.on('connection', function(socket){ r.table('users').changes().run(conn, function(err,…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
1
vote
2 answers

Creating secondary indexes in RethinkDB (javascript) not working as in doc

I am creating an index based on 2 fields in RethinkDB, in javascript (actually with rethinkdbdash driver). The code is like this : r.table('someTable').indexList().contains("indexName").do(containsIndex => { return r.branch( …
Spiky
  • 509
  • 4
  • 11
1
vote
2 answers

Node.JS Rethink-DB check if username and email is already exist

I working on a login/register system with Node based on the RethinkDB Chat example when I found that it doesn't check if the user exists with email or username something that's a problem. When I was looking to solve this I was not able to find out…
1
vote
2 answers

RethinkDB: Get last N from an object

What would be an efficient way to get the last N key-value pairs from an object? Sorted by key name and N being arbitrary integer. Ideally the returned type should also be an object.
user33946
  • 404
  • 6
  • 10
1
vote
1 answer

Short or long lived connections for RethinkDB?

We have a project on Node.js that is based on restify and we are using RethinkDB as a database. The problem is that RethinkDB should be accessed from different parts of code (from route handlers, middlewares), but not for all requests. I am…
AAzza
  • 65
  • 1
  • 5
1
vote
2 answers

sort nested timestamps in a query

I need to make a query with a list of Incidents and his nested events ordered DESC by his startedAt and timestamp dates. By default ReQL give the dates with a ASC order. I've got the folowing structure: { "id": …
Alejandro Silva
  • 8,808
  • 1
  • 35
  • 29
1
vote
3 answers

How do I get the rank / row number for a row?

Is there a way to get the row numbers (rank) for a filtered set and append the row number to the result? An example scenario would be that I have a table with records like: [ { points: 123, name: 'Glenn' }, { points: 948, name: 'Bob' }, {…
Glenn Morton
  • 444
  • 4
  • 15