Questions tagged [materialized-path-pattern]
46 questions
1
vote
1 answer
Objects from Materialized Path
I am trying to create an array of category objects from an array of materialized category paths.
var data = [
'Business / Finance',
'Business / Management',
'Business / Management / Leadership',
'Business / Team / Leadership'
];
//…

John B.
- 2,309
- 5
- 23
- 22
1
vote
0 answers
Sorting Root Elements by the Age of their Youngest Descendants
I have an SQLAlchemy model called Post. A post can have a parent post (foreign key on post.id, adjacency list pattern), and children (posts where its id is the parent_id). Each post also contains its materialized path (post.ancestry) to make…

user2619829
- 41
- 1
- 2
0
votes
1 answer
Select all rows that have ID in materialized path
I have this a tree structured table with a materialized path column (matpath).
The data looks like this:
ID MATPATH PARENT
---------------------
1 NULL NULL
2 1. 1
3 1.2. 2
4 1.2.3. 3
5 1.2. …

Francisc
- 77,430
- 63
- 180
- 276
0
votes
1 answer
How to load tree using Materialized Path tree structure with typeorm
I have an entity with 'materialized-path' tree structure.
I am trying to load the children. which gives an empty child object
Below is the entity
@Entity({ name: 'sector' })
@Tree('materialized-path')
export class SectorEntity {
…

Raj
- 125
- 2
- 2
- 14
0
votes
0 answers
Implementing a hierarchical system in django using django treebeard
I am trying to implement a web based organisational church system which has a hierarchy as shown in the diagram.
I want to implement the system using django treebeard materialized path.
I want each node on the tree to be an instance of a Church…

Kiki Kabira
- 1
- 2
0
votes
0 answers
represent tree data structure with multiple parents whose parent path is stored in model
I am trying to implement a organizational structure where one user can have more than one children users and parent users. Using cosmosDB as document database, I have stored the path of parent users in each user document.
Data Structure of user…

Bijay Kushawaha
- 172
- 2
- 12
0
votes
2 answers
Represent tree structure in Sql Server including Virtual paths
Hi I want to create a tree structure in a sql database. I need to have the following properties.
Fast Select
Easy to Select with only a string like Cat2/Cat4 -> Returns Cat5 & Cat6
Support of Virtual Categories
Insert should be easy, but not…

gulbaek
- 2,481
- 13
- 44
- 65
0
votes
1 answer
Looking for effecient way to store nested data with hibernate
I've been trying to find an efficient way to represent nested data in java/hibernate. My initial solution was a parent/child list with a self referencing join, but there are obvious pitfalls to this technique when building reports in SQL. I was…

Billworth Vandory
- 5,003
- 5
- 29
- 34
0
votes
1 answer
SQL to Doctrine's QueryBuilder conversion
I have ManyToMany relationship between Room and Rights entities. Doctrine automatically created third "room_rights" table. Rights are hierarchical and I use Materialized Path approach to store them in DB, so "rights" table has "path" field.
I'd…

Forseti
- 2,587
- 6
- 21
- 32
0
votes
1 answer
Efficient way to get ancestors - materialized path
I have a hierarchical data structure stored using materialized paths.
Table:Files
node parentNode name path
100 NULL f1 /f1/
101 100 f2 /f1/f2/
102 101 f3 /f1/f2/f3/
I have the node column as…

user3638992
- 87
- 2
- 9
0
votes
3 answers
Materialized path sorting order by date + path
I have database with comments (materialized path)(mysql). If i select all comm`s with "select * from comm where post_id=10 order by path ASC" in result i have comments from post ordered by path with older date on top and newer at bottom.
So, is…

SERG
- 3,907
- 8
- 44
- 89
0
votes
1 answer
Convert a flat array to a nested array using materialized path
I have some categories that I need to convert to nested array (tree). I use materialized path to make a tree and I work in PHP. Here's a print_r of what I have:
Array
(
[0] => Array
(
[_id] => mac
[name] => Mac
…

Anas Bud
- 347
- 4
- 15
0
votes
0 answers
Storing MongoDB tree using Materialized Paths pattern
I need to mimic a directory structure in mongodb. I have read about materialized paths pattern and this is the one I need to use
http://docs.mongodb.org/manual/tutorial/model-tree-structures/
The Materialized Paths pattern stores each tree node in a…

titzu
- 51
- 1
- 4
0
votes
0 answers
SQL Server: transforming query for materialized path traversing in a view
I would like to transform this query in a view that I can call passing the UserId as a parameter to select all groups (including subtrees of those groups) related to that user.
In fact I have 2 tables:
"EVA_Roles" which contains the roles tree,…

Manight
- 500
- 5
- 26
0
votes
1 answer
Mysql Update Using Regex for Materialized Path Structured Data
How can i perform an update query in mysql where i match the beginning of a string and replace that matched portion with another string?
The background of my problem is that I'm using materialized paths to structure my hierarchical data and need…

VinnyD
- 3,500
- 9
- 34
- 48