Joining within a collection/Selecting a large set of values
hello everyone,
i'm testing documentdb new project, , @ moment i'm not sure if , how can realize use case. lets have following in collection:
about 500000 employee records:
{ "id": "1", "type": "employee", "name": "testname", "lastname": "testlastname" } // , more
and have team records
{ "id": "45612354", "type": "team", "teamname": "greatteam", "members": [ 1, 55049, 29969, 23492 ] }
there can 50000 teams 10000 members each.
as input, i've specific team id , want return employee records of team. in rdbms create 2 tables, query team id , member ids in employee table. how here?
let each member have personal team list , id, every query need in list of every employee -> potentially check millions of ids.
is join operator applicable in case? can efficiently udf one: http://stackoverflow.com/questions/25637142/select-with-multiple-values-in-documentdb ? case should not use documentdb?
thanks help.
sebastian
ok, let's pretend teams & employees :)
don't embed entire employee record on team, no.
what meant on team, embed an array of employees
, on employee, embed an array of teams
example above has.
then employee records doing join single query
select e employee e join t in e.teams t.team = "a"
how employees change teams?
b/c model, have read entire employee document, make change team array , replace entire employee document again documentdb doesn't support patch/update, yet.
the part unclear on how perform arrays of 10,000 elements.
Microsoft Azure > Azure Cosmos DB
Comments
Post a Comment