Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array inside Array shift issue #114

Open
srajesh-elisity opened this issue Feb 18, 2022 · 1 comment
Open

Array inside Array shift issue #114

srajesh-elisity opened this issue Feb 18, 2022 · 1 comment

Comments

@srajesh-elisity
Copy link

shift.json

[
		{"operation": "shift", "over": "monitor.details", "spec": {"list[*].myname":"list[*].name", "id":"id"}}
]

doc.json

{
		"monitor" :{
			"name": "hello", 
			"details" : [
			{
				"list": [
					{
					"name": "abc",
					"id": "1"
					},
					{
					"name": "xyz",
					"id": "2"
					}
				] 
				
			}
			]
		}
	}

Expected Result:-

{
		"monitor" :{
			"name": "hello", 
			"details" : [
			{
				"list": [
					{
					"myname": "abc",
					"id": "1"
					},
					{
					"myname": "xyz",
					"id": "2"
					}
				] 
				
			}
			]
		}
	}

But Actual result,

{
		"monitor" :{
			"name": "hello", 
			"details" : [
			{
				"list": [
					{
					"name": "abc",
					"id": "1"
					},
					{
					"name": "xyz",
					"id": "2"
					}
				] 
				
			}
			]
		}
	}

Can you please correct my spec.json? Not sure, what I am missing.

@Rushi-Kumar
Copy link

Did you get an answer for this?, I too got stuck with the same kind of problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants