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

[BUG] Problem with many-to-one relationships inside DocumentDB #66

Open
meuriceloup opened this issue Mar 11, 2020 · 2 comments
Open

[BUG] Problem with many-to-one relationships inside DocumentDB #66

meuriceloup opened this issue Mar 11, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@meuriceloup
Copy link

Hi,
This is the deployed TML schema:

entity Product {
    id : String
    orders -> Order[0..*]
}
entity Order {
    id : String
    products -> Product."Product.orders"[1]
}

documentdb DocumentDatabase {
	collections {
		Order : Order
		Product : Product
	}
}

Once deployed, I executed this insert statement:
insert Product {id: "p2", orders: [Order {id: "o2"}, Order {id: "o3"}]}

the query finished with success but not sure it did what it was supposed to do...
Indeed, I connected my MongoDB database to take a look at the physical structures and the inserted data. This is what I noticed:

  1. the two orders were successfully inserted (see screenshot)
    image

  2. product 'p2' was also inserted BUT this product is linked to only one order , i.e., o3 (see screenshot)
    image

The problem seems to be due to the fact that field 'Product.orders' is defined as String field and not as an array of strings...

@meuriceloup meuriceloup added the bug Something isn't working label Mar 11, 2020
@DavyLandman
Copy link
Contributor

tnx for the bug report, I hope it's solved after we merge the new ql compiler.

@DavyLandman DavyLandman added this to the Compiled QL Queries milestone Mar 12, 2020
@tvdstorm
Copy link
Contributor

Hi @meuriceloup , same request as in for #67 , is this still an issue in the current version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants