neumino / thinky

JavaScript ORM for RethinkDB
http://justonepixel.com/thinky/
Other
1.12k stars 128 forks source link

What relation to put for array? - maybe to update your documentation #643

Closed goors closed 6 years ago

goors commented 6 years ago

Question

I have some document with:

name doc1

{
"some_key":"sample"
"ids_to_doc2":[id1, id2, id3]
}

and document with name doc2

{

"name":"name1"
"id":"id1"
}

{

"name":"name2"
"id":"id2"
}

{

"name":"name3"
"id":"id3"
}
  1. How to define relation hasMany or hasAndBelongsToMany?
  2. When doing select who final result will look like (i know this must be some merge)?

I used Doctrine for some php project and i am using Rethinkdb for 3 years now and this is first time that i am using any ORM for it.

doomedramen commented 6 years ago

Sorry, I have only just seen this, do you still wish to know?