Thinky is a JavaScript ORM for RethinkDB.
Questions tagged [thinky]
21 questions
2
votes
1 answer
Issue with connecting to rethinkdb from Windows 11 via thinky (nodejs)
I'm trying to onboard a new developer, that is using Windows 11 as the only one on our small team. I've guided him through installing WSL2 and Ubuntu 20.04.3 LTS (linux kernel: 5.10.93.2-microsoft-standard-WSL2).
We are 3 other developers who are…

dotnetCarpenter
- 10,019
- 6
- 32
- 54
2
votes
1 answer
RethinkDB Thinky - rows within 1 hour
r.db('dbname').table('urls').filter(function(url) {
return url("expires_at").date().eq(r.now().date())
.and(url("expires_at").hours().eq(r.now().hours().sub(1)))
});
I am trying to write the equivalent query using thinky ORM for node.js

Todd Resudek
- 123
- 5
2
votes
3 answers
thinky models in separate files: how to handle cyclical/circular dependencies
I tried to follow the example here, however have no luck with it.
I have User Model in user.js file:
import thinky from './thinky';
let type = thinky.type;
let User = thinky.createModel('User', {
id: type.string(),
username:…

almeynman
- 7,088
- 3
- 23
- 37
1
vote
0 answers
Error saving data to RethinkDB using Thinky
I'm starting to study and practice RethinkDB using Thinky, but I have a problem that takes a couple of days and I can't solve it.
Storing or saving data in just one collection works for me normally, even if I save the same data. Now I am testing…

Romero
- 11
- 1
1
vote
1 answer
Rethinkdb changesfeed in Express.js using thinky
Created a basic express.js application and added a model (using thinky and rethinkdb) trying to pass the changesfeed to the jade file and unable to figure how to pass the results of the feed. My understanding is that changes() returns infinite…

Marco
- 1,051
- 19
- 41
1
vote
2 answers
Using Think ORM in various files without reconnecting to database
I have a ton of models for thinky and I'm having to create an object in each file for thinky and its connecting like 10 times because I have that many models.
var dbconfig = require('../config/config.js')['rethinkdb'];
var thinky =…

Parth Patel
- 157
- 5
1
vote
1 answer
Connecting to compose.io rethinkDB server with thinky.io
I am trying to connect to a hosted rethinkDB server on compose.io using thinky.io
According to the docs I can connect with the following using r.connect:
const r = require('rethinkdb');
const fs = require('fs');
fs.readFile('../cacert',…

alex
- 5,467
- 4
- 33
- 43
1
vote
1 answer
Rethinkdb and Thinky how to saveAll on multiple models in a model that has a 'hasMany' relationship where parent model contains array of child models
Very hard question to articulate but here goes. Ultimately I have a set of models in RethinkDB that are related to each other in a sort of chain pattern. I am experiencing a problem when I want to use a field defined with a "hasMany" relationship,…

don_vito
- 136
- 1
- 6
1
vote
1 answer
Thinky.io hasMany not saving new model instances
I am struggling with joining my User and Job Models using Thinky.io.
In the docs, there is an example here of how hasMany works to attach posts to an author. I would like the same set-up for our users: each user would ideally have a job field that…

A. Rosato
- 11
- 3
1
vote
1 answer
How can you match a field in Thinky ORM?
I am trying check if one field from a table does exists (Case In-sensitive) using Thinky ORM. Without Thinky, I can match a field just using RethinkDB simple filter-match operations:
// This makes my variable insensitive.
let myFieldInsensitive =…

Lucaci Sergiu
- 564
- 5
- 17
1
vote
2 answers
Outer variables not being altered inside Promise.then function
On node while using thinky.js, I am trying to iterate through a loop and add each item to an array. This however, for some reason is not working.
In another place, it is indentical and working, just without a Promise.then function. Why is this not…

kRIST-
- 186
- 1
- 7
1
vote
0 answers
How should I do a PUT request with a JOIN in Thinky?
How would I handle a PUT request where I want to update and object, and then do a join for the provided tag ids?
I have this so far:
ctrl.put = function *(next){
var id = this.params.id;
var data = this.request.body;
var tags = data.tags;
…

chovy
- 72,281
- 52
- 227
- 295
1
vote
1 answer
Multiple 'belongsTo' relationships on thinky model
I have two models, User and Capture, where a Capture can be related to multiple users: it is owned, claimed, and processed all by three different users.
User = thinky.createModel 'User',
id: String
displayName: String
email: …

Josh Hunt
- 14,225
- 26
- 79
- 98
0
votes
1 answer
How to create a new n-n model using thinky and link it to an existing one?
I just started using rethinkDB and thinky. I wanted to ask how I go about creating a new instance of a model which has n-n relationship with an already existing model.
For example, if I have a model for Pizzas and Toppings. I already created a Pizza…

Curtwagner1984
- 1,908
- 4
- 30
- 48
0
votes
1 answer
Enforce uniqueness in thinky (rethinkdb)
In the thinky.io docs the following pattern is described to enforce uniqueness:
var Model = thinky.createModel("user",
name: type.string()
}, {
pk: "name"
});
Where the name property is assigned to the primary key.
Is this a typo? That is,…

alex
- 5,467
- 4
- 33
- 43