From 4ee4026d6ef82762f20dcd19dcbbe86c8f76b810 Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Thu, 30 Jun 2022 10:23:35 -0400 Subject: [PATCH] docs(Readme): Add documentation for nested array --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 4c7d3710..7e6bad86 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,34 @@ db.getIndex("/arraytest/myarray", "test", "name"); // It's useful if you want to delete some object db.delete("/arraytest/myarray[" + db.getIndex("/arraytest/myarray", 65464646155) + "]"); +``` + +#### Nesting in Array +```javascript +// You can easily access any nested array and their object +//You can also append to nested array other array +db.push("/arraytest/myarray", +[ + [ + { + obj: 'test' + }, + { + obj: 'hello' + } + ], + [ + { + obj: 'world' + } + ] +] +, true); + +//This will return the first object (obj: 'test') + +db.getData("/arraytest/myarray[0][0]"); + ``` ### Exception/Error #### Type