
                if (inObject && curlyBraceCount === 0) {
                    let jsonstr = buffer.slice(objstart, i + 1);
                    objend = i;
                    inObject = false;
                    try{
                        const jsonObject = JSON.parse(jsonstr);
                        if(elemcounter>=elemstart && elemcounter<elemend)
                        {
                            newdb.push(jsonObject);
                        }
                        ++elemcounter;
  