I use: Laravel mongodb (https://github.com/jenssegers/laravel-mongodb)
I have table relation in MySQL
table: apps
ID
Name
table: clients
ID
Name
And table relationship: app_client
app_id
client_id
version
field 'version' in table app_client is string type
How to create relational tables in MongoDB as containing the version column?
I create table in Mongodb: table: apps
ID
Name
client_ids => is array: [ObjectID('client_id'), ObjectID('client_id')]
table: clients
ID
Name
app_ids => is array: [ObjectID('app_id'), ObjectID('app_id')]
My Eloquent (Model Client):
public function apps(){
return $this->belongsToMany('Model\App', null, 'client_ids', 'app_ids');
}
But, not column version Do you know what I mean? How to create column version in database mongodb for Eloquent?