All Questions
256
questions
0
votes
1
answer
53
views
How to format json object by specific value in NODEjs
I have a json object in NODE like this:
{
"data": [
{
"groupname": "TestGroup001",
"description": "Test Gruppe für xyz...",
...
1
vote
3
answers
125
views
How to customize/modify JSON Response from object query result?
project using : nodejs, expressjs and database mssql 2000 with node-mssql
I have an object sample resulted from query table as follow. the length of object will vary depend on different "model ...
1
vote
2
answers
53
views
How to change data in array with object which was copied?
I'm beginner in JS
Can you help me with simple question, pls?
e.g. I have array such as:
const array = [{
id: 1,
name: 'Ferrari',
type: 'F40',
price: '350 000$',
country: 'Italy'
}]...
0
votes
1
answer
728
views
Using lodash isEqual() to compare single object property with matching properties from large array with multiple objects
I've looked at lodash documentation and played around with comparing simple objects. I've also found a number of explanations online for comparing entire objects and other types of comparisons, but I ...
-1
votes
1
answer
34
views
Return object result [closed]
I need to get the result of this object, I've tried json.count(id_reported) and json['count(id_reported)'] but none worked.
const json = {
'count(id_reported)': 21
};
//console.log(json....
0
votes
1
answer
52
views
Iterating the creation of objects with asynchonous javascript map method data [duplicate]
In an async IIFE at the bottom of this javascript, you'll see that I'm trying to: 1) read a JSON file, 2) get multiple RSS feed URLs from that data, 3) pull and parse the data from those feeds, and ...
-2
votes
2
answers
63
views
How to delete an empty property of an object? [duplicate]
I'm new in JS and I want to delete the property "" of an object like this:
{tecnico2: 1.1, "": 0, tecnico4: 5, tecnico1: 3, tecnico3: 3}
to
{tecnico2: 1.1, tecnico4: 5, tecnico1: 3,...
-1
votes
1
answer
126
views
Convert flat structure with any number of levels array into tree structure
I want to convert flat structure array into a tree structure for one my projects. Below is the input and expected output:
Input:
let input=[
{
lvl1:"Code1",
lvl2:"...
1
vote
2
answers
439
views
Get specific value in a Nested Object and save to a variable
i have an object in a data.json file with different ids. I want to grab a specific id by if the type === admin and save it to a variable called adminID. How can I achieve this?
data.json
{
"...
1
vote
0
answers
93
views
Loading large JS object working in NodeJS but not in NextJS
In one NodeJS app I have a function that simply imports a large (140MB+) object from a JavaScript file, as so:
import bigObject from '../../../seeds/bigObject.js';
export default async function ...
0
votes
1
answer
40
views
use the filesystem module and the string.replace() to Substitute tokens in a nested object
When I run node index I get undefined. I am trying to use the filesystem module and the string.replace() method to replace tokens in a nested object in collections.js with values from another file (...
0
votes
1
answer
385
views
Replace Strings in a nested Object with values from another file using `string.replace() Method`
How can I replace the tokens __fruit_type__, __clothing_type__, __fitness_equipment__, __meditation_app__ in collection.js with values from values.js?
I am trying to achieve this with the string....
0
votes
1
answer
82
views
Edit a deep part of an object with string key with dots
i need to merge two objects, where one is a part with some changes of an old one.
So, we have an object that looks like this (example):
{
"item": {
"data": "some text ...
0
votes
0
answers
41
views
How to change url param to object without changing value type?
I am trying to change a url param to object?
const url = key=hhdfghh&num=123
const params = Object.fromEntries(new URLSearchParams(url));
console.log(params);
params.num = '123'
But i want it to ...
-2
votes
2
answers
44
views
How can I create a new Object from a JSON value without changing the parent in JS? [duplicate]
I've been working with JS + JSON, and I can't find a way to make a new object out of a value of some parent object. For example:
const parent = {
"child": {"value": 12},
"...