We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
eq
neq
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
data:
{ "appStatus": { "displayName": "JobServer", "instanceStatus": { "autoRestartSuspended": false, "autoRestartSuspendedForApp": false, "autoRestartableApp": false, "instance": { "active": true, "applicationDisplayName": "JobServer", "applicationId": 42, "applicationName": "JobServer", "custom": false, "id": 10, "name": 1, "serverName": "xxx" }, "lastStartTime": "2022-11-06 11:53:52", "lastStatusChangeTime": "2022-12-14 16:37:31", "lastStatusEvent": "Stop", "lastStopTime": "2022-12-14 16:37:31", "status": "STOPPED" }, "name": "JobServer", "numberOfInstancesDown": 1, "numberOfInstancesRunning": 0, "outageCountInLast24Hrs": 1, "pecentageUpInstance": 0, "status": "Red", "totalNumberOfInstances": 1 } }
code:
notStopped := jq.New().File("out.json"). From("appStatus.instanceStatus"). Where("status", "neq", "STOPPED") log.Println(notStoppped) log.Println(notStopped.Get())
output:
Content: { "appStatus": { "displayName": "JobServer", "instanceStatus": { "autoRestartSuspended": false, "autoRestartSuspendedForApp": false, "autoRestartableApp": false, "instance": { "active": true, "applicationDisplayName": "JobServer", "applicationId": 42, "applicationName": "JobServer", "custom": false, "id": 10, "name": 1, "serverName": "xxx" }, "lastStartTime": "2022-11-06 11:53:52", "lastStatusChangeTime": "2022-12-14 16:37:31", "lastStatusEvent": "Stop", "lastStopTime": "2022-12-14 16:37:31", "status": "STOPPED" }, "name": "JobServer", "numberOfInstancesDown": 1, "numberOfInstancesRunning": 0, "outageCountInLast24Hrs": 1, "pecentageUpInstance": 0, "status": "Red", "totalNumberOfInstances": 1 } } Queries:[[{status eq STOPPED}]] 2022/12/14 20:48:31 map[autoRestartSuspended:false autoRestartSuspendedForApp:false autoRestartableApp:false instance:map[active:true applicationDisplayName:JobServer applicationId:42 applicationName:JobServer custom:false id:10 name:1 serverName:xxx] lastStartTime:2022-11-06 11:53:52 lastStatusChangeTime:2022-12-14 16:37:31 lastStatusEvent:Stop lastStopTime:2022-12-14 16:37:31 status:STOPPED]
Changing where to eq produces exactly same output. I would think that neq should return an empty map instead?
Another test with neq:
notStopped := jq.New().File("out.json"). From("appStatus"). From("instanceStatus.instance"). Where("name", "!=", 1)
Returns:
map[active:true applicationDisplayName:JobServer applicationId:42 applicationName:JobServer custom:false id:10 name:1 serverName:xxx]
So it would appear that neq and != do not work as expected?
!=
Any help in getting this working? Am I doing smth wrong?
PS: is this lib maintained? Seems like not much activity going on lately.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
data:
code:
output:
Changing where to
eq
produces exactly same output.I would think that
neq
should return an empty map instead?Another test with
neq
:Returns:
So it would appear that
neq
and!=
do not work as expected?Any help in getting this working? Am I doing smth wrong?
PS: is this lib maintained? Seems like not much activity going on lately.
The text was updated successfully, but these errors were encountered: