Questions tagged [rethinkdb-javascript]

JavaScript driver for RethinkDB

JavaScript driver for RethinkDB.

197 questions
0
votes
2 answers

Can I get shorter UUIDs in RethinkDB?

Is there a way to get shorter unique IDs for entries in RethinkDB? We have a URL scheme where /:ID URLs get very long with the default ID Their docs don't seem to talk about this... https://rethinkdb.com/api/javascript/uuid/
Qasim
  • 1,554
  • 1
  • 13
  • 22
0
votes
1 answer

ReQL equivalent of Select * from table where id in ()

I am new to RethinkDB, I have an array of object ids, I want to fetch object from a table whose id belong to this array. SQL query would be - SELECT * FROM orgs WHERE id IN ('ID1','ID2'); I tried following in myREQL console-…
Bopsi
  • 2,090
  • 5
  • 36
  • 58
0
votes
1 answer

Condition inside getAll for compound index

what will be the equivalent query for select * from emails where to="someemail" and from="some@email" need to use get instead of filter
nicky
  • 3,810
  • 9
  • 35
  • 44
0
votes
2 answers

Rethinkdb The many-to-many relationship

I have tables of the following kind entity |id|title| entity_authors |id|authorName| entity_to_authors |id|entityId|authorId| I managed to join the tables entity and entity_to_authors r.table("entity") …
MadLax
  • 1,149
  • 3
  • 10
  • 13
0
votes
2 answers

Aggregate multiple fields in one rethinkdb query

How to reduce / aggregate multiple fields in a table? This does not seem efficient: r.object( 'favorite_count', r.db('twitterdb').table('tweets').map(tweet => tweet('favorite_count')).avg().round(), 'retweet_count', …
art1fa
  • 23
  • 3
0
votes
1 answer

conflict="error" not being honoured with rethinkdbdash

I am using rethinkdbdash for the first time and I am attempting to simply create a user but error out if it exists. From all of the documentation I have read the following code should work, however it keeps inserting never actually detecting a…
0
votes
1 answer

r.table('table').filter({thing : 'thing'}).run(conn, function(err, result) {}) returning undefined

So I,m trying to filter my database for names with this code: r.table('Profiles').filter({mcname : user}).run(connection, function (err, profiles) { console.log(r.table("Profiles").filter({mcname : user}).toString()) …
0
votes
1 answer

RethinkDB - Automatically generating primary keys that are linear

Is there a way to make rethinkdb generate primary key automatically and to ensure the key is in an increasing order., like say 1 to n I know when we insert a row into rethinkdb it automatically generates a primary key and returns a variable…
coderb
  • 27
  • 5
0
votes
1 answer

Rethinkdb query to fetch data between 2 epoch times

I'm trying to run a ReQL query to fetch the data between 2 epoch times, i have a field called "lastUpdatedDttm" using which i'm trying to run the query like below. The lastUpdatedDttm field type is "number" and is just new…
Sai
  • 1,790
  • 5
  • 29
  • 51
0
votes
1 answer

Why can't I append an object to an array in rethinkdb?

I am trying to append an object into an array in rethink. Here is how I am trying to append it: rethink.table('shifts') .get(shiftId) .update(row => row("milestones").default([]).append({ dateAchieved: "2017-01-01", …
jhamm
  • 24,124
  • 39
  • 105
  • 179
0
votes
1 answer

Why can't I append an object in an array in Rethinkdb?

I am trying to append an object into an array in rethink. Here is how I am trying to append it: rethink('shifts') .get(shiftId) .update(row => row("milestones").default([]).append({ dateAchieved: date, …
jhamm
  • 24,124
  • 39
  • 105
  • 179
0
votes
1 answer

Apply delta values on nested fields

Suppose I have record like this: { id: 1, statistics: { stat1: 1, global: { stat2: 3 }, stat111: 99 } } I want to make update on record with object: { statistics: { stat1: 8, …
0
votes
1 answer

How to use multiple indexes to filter and group?

In RethinkDB, is it possible to filter and group in a single query using indexes for efficiency in both operations? For instance: r .db('db') .table('table') .getAll('123', {index: 'serverId'}) .group({index: 'userId'}) …
Chris Talman
  • 1,059
  • 2
  • 14
  • 24
0
votes
1 answer

How can I do eqJoin with two or more fields in rethinkdb?

I need to do a join operation in rethinkdb (eqJoin) but using two or more fields and not only 'gameId' r.table('players').eqJoin('gameId', r.table('games')).run(conn, callback)
yussenn
  • 577
  • 1
  • 7
  • 11
0
votes
1 answer

RethinkDB - Reduce results of list field

I have a dataset with a field that contains a list of strings for each document. I'm looking for a query that will give me the list of unique strings in that field I thought reduce might be what I'm looking…
ebbishop
  • 1,833
  • 2
  • 20
  • 45