I have this JSON document:
{
userId: xx,
followedAuthors: [
{ authorId: abc, timestamp: 123 },
{ authorId: xyz, timestamp: 456 },
]
}
When a user want to follow an author I would like to write a query that check if that author is…
I am trying to do simple upsert to the array field based on branch condition. However branch does not accept a reql expression as argument and I get error Expected type SELECTION but found DATUM.
This is probably some obvious thing I've missed,…
I would like to apply in one query a document replacement but i would like to keep a specific property (createdAt) from the old document.
The old document :
{id: "xxx" title: "my title", description: "my desc", createdAt: "1507844981006"}
The new…
I'm trying to check if a value exists in my rethinkdb table.
It seams like its giving 2 responses.
I do it this way:
router.param('gamename', function(req, res, next, gamename) {
// do validation on gamename here
console.log(gamename);
…
How can I get one document only by query in RethinkDB?
for an example, I want to get the document by this query below:
let searchQuery = {
name: 'rob'
}
var cursor = await r.table('users').filter(searchQuery).run(connection)
var user =…
I am trying to filter a rethinkdb table (conversations) which contains nested object array called participants. The structure is below.
I am trying to execute a query that selects conversations based on the IDs of the participants.
in plain…
I'm using a NodeJS application with a RethinkDB database.
When i start the server the application establish a connection with Rethink and it starts to listen to the changes in a table using RethinkDB feeds.
The problem is when RethinkDB goes down.…
Using branch update logic in rethinkdb. I am needing to update a value based on wether another value matches and then set the appropriate value. If the values are the same it should use the existing…
How to Join with multiple conditions and use aggregate function in Rethink-db
r.table("yourtable").get(id).innerJoin(
r.table("secondtable"),function (up, upp) {
return user_profile("mID")
}).map({
uId: r.row("left")("userId"),
…
I'm trying to write a RethinkDB generic repository in typescript.
I saw that RethinkDB javascript returns promises, I'd like to, for example in GetAll method, return the array items. For the moment I wrote something like this:
public GetAll(): T[]…
I have a document schema like this:
{
"name":"",
"type":"",
"posts":[
{
"url":"",
"content":"",
...
},
{
"url":"",
"content":"",
...
}
...
]
}...
I forgot to create id's for each post on insertion in database. So i'm trying to create a query for…
Are there any best practices or ReQL features that that help with composing complex ReQL queries?
In order to illustrate this, imagine a fruits table. Each document has the following structure.
{
"id": 123,
"name": "name",
"colour":…
I am working with the Reql, the problem i am facing is that i need to filter the same plucked values in correct order.
After pluck and distinct() apply, value are correct but not in correct order, their order lost.
Sample…
I have a table in RethinkDB consisting of 3 millions tweets. Each field has an epoch time, when it was inserted. What javascript query could I make to get quickly the tweets from the last 24 hours (roughly about 50k) sorted by keyword? I tried…