Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relation on json or array records #2492

Open
AliAmini78 opened this issue Jan 9, 2023 · 0 comments
Open

relation on json or array records #2492

AliAmini78 opened this issue Jan 9, 2023 · 0 comments

Comments

@AliAmini78
Copy link

AliAmini78 commented Jan 9, 2023

Laravel Version: 9
PHP Version: 8.1
jenssegers/mongodbn: 3.9

i have two models and i want them to have a relation together , Property and Attributes

and property record is :

Property :=> [
   "_id" => "63bbb87fb7200dc8b30f45d2"
  "title" => "apartment",
  "attribute_json"=> [
            [
                "attribute_id" => 63b44c35eb7f96ff2308d09a,
                "options" => [
                  "value" => 123,
                   "option_id" => "63b44c35eb7f96ff2308d09b"
                ]
             ], [
                "attribute_id" => 63b5663879968d98e301b251,
                "options" => [
                  "value" => 123,
                   "option_id" =>[
                             "63b6899342a118a29a2292d9",
                             "63b51efe79968d98e301b23f"
                             ]
                ]
             ],
              [
                "attribute_id" => 63b5664879968d98e301b252,
                "options" => [
                   "option_id" => "63b5023c79968d98e301b236"
                ]
             ], 
[
                "attribute_id" => 63b6d35d585250198b0230e2,
                "options" => [
                   "option_id" => [
                                          "63b6d35d585250198b0230e3"
                                           "63b6d35d585250198b0230e4"
                                           ]
                ]
             ],
              [
                "attribute_id" => 63b6d35d585250198b0230e5,
                "options" => [
                  "value" => 456,
                ]
             ],

          
     ],
]

and in this record attribute_id and option_id is in same model and table .
and how can i make relation between attribute_id and property , and also make another relation between option_id and property ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant