Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

If I wanted to make a nested set: nested_set = {{1, 2, 3}, {6, 4, 5}, {12, 8, 5, 7}} It would give the error: TypeError: unhashable type: 'set' However if I wanted to make a nested list: nested_list =...
frix's user avatar
  • 1
0 votes
0 answers
41 views

I'm trying to rebuild nested sets values using a query The problem is that i'm getting an error Query 3 ERROR at Line 110: : Can't reopen table: 'tmp_tree' What seems to be the problem? My directories ...
Ahmed Nagi's user avatar
0 votes
0 answers
52 views

This is complicated to understand but I really will do my best at explaining what i'm trying to do. I need help in trying to figure out how to achieve a result. Not necessarily the code to do it but ...
rctneil's user avatar
  • 7,240
4 votes
0 answers
2k views

I'm working with Laravel, Filament Admin panel, and staudenmeir/laravel-adjacency-list. I'm struggling to bring this nested tree structure into the CategoryResource List table through getEloquentQuery(...
Curtis B's user avatar
0 votes
0 answers
62 views

I'm given a nested set database which has the following reduced structure: Bus its root table (B) CL CR SL SR 1 6 1 12 Compound table which represents levels of hierarchy with each level having ...
redead's user avatar
  • 380
1 vote
0 answers
474 views

I am using kalnoy/nestedset package (https://packagist.org/packages/kalnoy/nestedset) to store categories and sub-categories in a hierarchical structure. I have at max 5 levels deep hierarchy (mostly ...
Murlidhar Fichadia's user avatar
0 votes
1 answer
748 views

I have a table with a nested set so each row has a lft & rgt value. When a new row is inserted into the table the nodes following need to have their lft & rgt values incremented by 2 and then ...
Dercni's user avatar
  • 1,224
0 votes
1 answer
128 views

I'm trying to use a non-recursive depth-first-search approach to read directories and build nested sets. I need to assign left, right, and depth values to the path of the given directory(Files at the ...
BoboTheKnight's user avatar
0 votes
0 answers
68 views

I am maintaining the Mike Hillyer Hierarchical Data in MySQL. Q) How to optimize the update statement below. It will take average about 500 Milliseconds update AGENCY_TREE set RGT = RGT - 2 where RGT ...
Banana Tech's user avatar
0 votes
0 answers
95 views

I have a table with nested children. I'm trying to fetch a list of parents sorted by the most recent child, when available, otherwise the parent's created date. My query seemed to work at first, but ...
Jeremy's user avatar
  • 179
0 votes
0 answers
1k views

I'm using nested set version 6.0.0 on laravel v7.30.4, I added columns to migration: Schema::table('companies', function (Blueprint $table) { $table->nestedSet(); }); And this ...
Marzie Tajik's user avatar
0 votes
1 answer
412 views

Hey I'm trying to implement nested drag&drop within re-order sequencesin my MERN app. I working to find ideal approach for mongodb data model and implement to Lexicographic order or linked lists ...
MezzoMortoHuseyinPasa's user avatar
0 votes
2 answers
142 views

I have a Set Set: Set<Set<Integer>> nestedSet = Set.of(Set.of(1, 9), Set.of(0,2,4), Set.of(14,1), Set.of(2,23,13), Set.of(14,22)); What i want to archive, is to stream through the ...
lz01's user avatar
  • 47
0 votes
2 answers
261 views

I'm modeling a category hierarchy in postgres using the nested set model as explain here. I am using a query to find the immediate subordinates of a node which is explained below in an excerpt from ...
Joe B.'s user avatar
  • 820
1 vote
1 answer
156 views

I have nested sets data from my db and need transform this to tree data structure: type Item = { Id: int Left: int Right: int Level: int } type Items = Item list type Tree = {Parent: ...
user15549828's user avatar
1 vote
0 answers
1k views

I am working on a Laravel application where I used kalnoy/nestedset package to make the tree structure for color categories. Now I want to know the level of the node related to the tree. For example ...
Sachin Kumar's user avatar
  • 3,276
-1 votes
1 answer
162 views

Find below the controller code and blade file code, Tested & Working Controller Code: $nodes = Category::get()->toTree(); Blade File Code Returning Value = 6 {{$data->category_id}} I need ...
Vijender singh's user avatar
3 votes
2 answers
911 views

i get this error when delete object in nested in nestedset in laravel "Declaration of Kalnoy\Nestedset\BaseRelation::getRelationCountHash() should be compatible with Illuminate\Database\Eloquent\...
saber tabatabaee yazdi's user avatar
1 vote
1 answer
397 views

i have a Nested Set Tree and i am searching for an SQL query to retrieve the first ancestor of each node. I will always get the root node or a list of all ancestors. See: Nested Set Query to retrieve ...
Andreas's user avatar
  • 33
0 votes
1 answer
580 views

I have been playing around with some Nested Set Models (NSM). One thing I wanted to do is to be able to generate a NSM from a given JavaScript object. For example, given the following object: var ...
Fraser's user avatar
  • 17.2k
0 votes
0 answers
2k views

I'm managing categories with (Atlantic18/DoctrineExtensions) Gedmo Nested Set Tree strategy in Symofny4 application. I need to reorder the existing tree passing an array of rearranged categories to ...
Jack Skeletron's user avatar
2 votes
1 answer
602 views

I have the following Nested Set That results in this tree 1 - |---- 2 - | |---- 4 - | |---- 7 | |---- 8 |----10 - |---- 9 3 - |---- ...
LoadIt's user avatar
  • 137
1 vote
1 answer
1k views

I am using this package to handle hierarchy data in Laravel: https://github.com/lazychaser/laravel-nestedset Their is an implemented functionality which provides the opportunity to create new data ...
Mango D's user avatar
  • 473
0 votes
0 answers
383 views

I have a large bifurcating hierarchy of 4 million nodes (2 million tips), organised as a nested set in an mySQL table (i.e. with rgt and lft positions defined for each node). I want an efficient way ...
user2667066's user avatar
  • 2,179
1 vote
0 answers
118 views

i try to create the sql tables and statements for my scenario. I use mySQL. I have a standard hierarchical structure for documents but the structure of a specific document for a client can be ...
Basti G.'s user avatar
  • 441
0 votes
1 answer
1k views

I'm trying to solve a problem, where I need to calculate nutrition values of a recipe like a "My sandwich" I have a database with "recipes" and "ingredients" and the amount needed in kg. a recipe ...
inckie's user avatar
  • 191
0 votes
1 answer
45 views

I'm retrieving the paths of leafs and there is repeated leaf names in nested set. After executing query different paths where leaf name is repeated came joined together. i tried to fix sql code but ...
Abay's user avatar
  • 11
1 vote
1 answer
463 views

I use laravel-nestedset and I can get all categories and its children with this code: code1: $categories = $this->traverse(Category::defaultOrder()->get()->toTree(), null); For checking ...
Areza's user avatar
  • 721
1 vote
1 answer
541 views

I have the following schema: defmodule MyApp.Folder do use Enterprise.Web, :model schema "folders" do has_many(:contracts, MyApp.Contract) has_many(:child_folders, MyApp.Folder, ...
Bargain23's user avatar
  • 2,013
1 vote
2 answers
72 views

I'm using nested set comments (Kalnoy package) in my project and I'm stuck at creating children comments. I created two different method for both type of comments. Saving root comments works fine: ...
Lidia Mokevnina's user avatar
1 vote
1 answer
2k views

I'm using Kalnoy/Nestedset and trying to seed my comments table using faker, but get "Array to string conversion" error. The comment table looks like this: Schema::create('comments', function (...
Lidia Mokevnina's user avatar
2 votes
1 answer
7k views

I tried to seed nested set with array with Laravel 5.7 and https://github.com/lazychaser/laravel-nestedset package but always getting : Array to string conversion error when function gets to main ...
Akwinsky's user avatar
  • 363
0 votes
0 answers
33 views

Does nested-sets model suit only for categories/catalogs (e.g fruits, vegetables), or for end-elements too (such as apple, onion etc.)? Let's imagine my website is selling fruits and vegetables, and ...
Timur Abdrashitov's user avatar
1 vote
1 answer
155 views

I am using Rails 5.1.6 I have a model called Taxon using acts_as_nested_set. I have 4 levels of Taxons, the last level sub_category has an attribute holding names of all parents, I want to update the ...
Selim Alawwa's user avatar
0 votes
0 answers
309 views

I have a MySQL table storing a binary tree in a nested set model with some extra properties. The binary tree is neither full nor complete, so there may be nodes on the middle with only one child. It ...
balsa0's user avatar
  • 1
1 vote
1 answer
127 views

Working with laravel-nested sets Baum's package and try to import tree into mysql database. Import data: 1. FirstLevelWord1 - SecondLevelWord1 - ThirdLevelWord1 - FourthLevelWord1 2. FirstLevelWord1 -...
Nastya Keller's user avatar
0 votes
0 answers
453 views

I can get descendants from one ID like this: return $node = \App\Categories::where('id',41) ->first() ->getDescendants()->pluck('id'); I wonder if it's possible to get descendants of ...
Galivan's user avatar
  • 5,388
1 vote
0 answers
304 views

I have a pretty specific issue here that I'm trying to work out, and I'm really not sure it's possible but I figured it's worth a shot. I am using an Eloquent model to manage categories for FOUR ...
HirtLocker128's user avatar
0 votes
0 answers
44 views

tldr (short version): Is there a more efficient way to have my update left values query not fail and ruin a transaction if there are no left values to update? Long Winded Version if need more info. ...
Brett Williams's user avatar
0 votes
1 answer
1k views

Maybe its just late in the day and this is making my brain melt. I'm trying to convert a flat list of nested sets into a multi-dimensional nested array. I have a bunch of structured CMS entries as ...
JimBlizz's user avatar
  • 384
0 votes
0 answers
2k views

If we write something like below in ItemsList component: render(){ return( <div> <ul> {this.props.items.map(item => <Item key={item....
WannaBeBetter's user avatar
1 vote
1 answer
2k views

I got an array of objects and need to recursively render every single object like unmarked list : <ul> <li> </li> </ul> All data comes from server like simple JSON: { ...
WannaBeBetter's user avatar
2 votes
2 answers
993 views

There is following data. [ {"no":1, "name":"ELECTRONICS", "depth":0}, {"no":2, "name":"TELEVISIONS", "depth":1}, {"no":3, "name":"TUBE", "depth":2}, {"no":4, "name":"LCD", "depth":2}, ...
left click's user avatar
1 vote
2 answers
253 views

Tree comment system implemented as simple nested set +---------+-----------+---------+---------+-------+--------+ | id | parent_id | lft | rgt | depth | rating | +---------+-----------+---...
Dima Melnik's user avatar
4 votes
1 answer
3k views

This uses two queries and I like to get result for each rows returned in the first subquery that will run the second query, essentially this will act like a foreach loop. I hope there is someone who ...
Rajib Hossain Pavel's user avatar
1 vote
1 answer
324 views

From the nested sets reference document written by Mike Hyller and other blogs, I could understand how hierarchies are being managed in RDBMS. I was also able to successfully implement the model for ...
Nagarajan Shanmuganathan's user avatar
0 votes
1 answer
1k views

I'm trying to implement jqTree with Laravel app. Controller gets data and return view: public function index() { $categories = Category::get(['id', 'name', '_lft', '_rgt', 'parent_id'])->toTree();...
simke's user avatar
  • 5
0 votes
0 answers
330 views

I want to develop a KPI system but have some trouble on database design Before I start, let me higlight first the business requirement: Parent can get all child KPI. For example from image below (...
cyberfly's user avatar
  • 5,918
0 votes
1 answer
87 views

Let's say I have a tree of categories, where each node in the tree is stored as a row in the database. The approach taken is a nested set. A sample tree for a clothing store would be: id | name ...
user3919580's user avatar
3 votes
3 answers
1k views

I have a table containing details on my company's chart of accounts - this data is essentially stored in nested sets (on SQL Server 2014), with each record having a left and right anchor - there are ...
Pete's user avatar
  • 1,897

1
2 3 4 5
8