Query on JSON response returns, Parse exception Unexpected end of input - json

Good day,
Hope you are well.
I am trying to use the Vincere API, and trying to query the response to only return where private_job:0. I am using Postman to test the API.
When I use the below request, doing my best to follow the instructions on the Documentation:
https://domain.vincere.io/api/v2/job/search/fl=job_title,private_job;sort=published_date asc?q=private_job:0
I get the following response:
"Parse exception Unexpected end of input, expected term_char, ws0, term or term_end (line 1, pos 14):\nprivate_job:0\n ^\n"
If I remove ?q=private_job:0, I get a valid response.
I am clearly doing something wrong. Please assist.

in query parameter the key name is q ,
q=private_job:0
but in documentation it says instead of q it should be fq
https://domain.vincere.io/api/v2/job/search/fl=job_title,private_job;sort=published_date asc?fq=private_job:0
Also if you are using special character q=private_job:0 # , then give the value in the query parameter session of postman it will url encode it automatically for you

This stumped me as well, turns out my issue was twofold.
Firstly, this error refers to their URL parser expecting to see the end character %23, so your query string needs to end with that.
Secondly, I was attempting to query the job_type and using the actual string value ie. job_type:PERMANENT%23. This actually needs to be the enum value (1 in this case).

Related

MySQL JSON Query: Invalid JSON text in argument 1

I am building a stats table that tracks user data points. The JSON is dynamic and can grow for multiple levels. I'm basically getting an error about invalid JSON using json_merge_patch, which I have used often before. I can not figure out why this is giving me the following error:
ERROR: Invalid JSON text in argument 1 to function json_merge_patch: "Invalid value." at position 0.
insert into
stats.daily_user_stats
VALUES
(null,'2022-02-02',1,18,3,'{"pageviews":{"user":1}}')
on duplicate key update
jdata =
if(
json_contains_path(jdata, 'one', '$.pageviews.user'),
json_set(jdata, '$.pageviews.user', cast(json_extract(jdata, '$.pageviews.user')+1 as UNSIGNED)),
json_merge_patch('jdata','{"pageviews":{"user":1}}')
)
Any help on identifying why the JSON I'm passing to the json_merge_function is not correct?
Solved. The json_merge_patch should look like this:
json_merge_patch(jdata,'{"pageviews":{"user":1}}')

Invalid property name: `errorType` on class `java.lang.String`. Validate that the correct setters is present

When I try to use a json-logger in Mule 4. I'm getting this error. I'm trying to log a error object here but it is not getting successfull. Please find the error object below.
I sorted out the issue. The issue was we cannot give JSON in the MESSAGE section of json-logger. When i changed it to a string. It worked
The MESSAGE section is meant to describe what you are going to Log.
It looks like you are trying to use the function stringifyNonJSON() with a Mule error and treat it like a String. Without more details of the flow and the payload it is not possible to have more insights.
You could try to create a string from the payload manually first and use that as the parameter, as the function is not able to handle this case apparently.

how to insert query and save json data into sql server using nodejs

I am trying to insert query into SQL Server using window authentication with nodejs. I have done with get request of select query. but now am trying the post request with insert query. But I can't pass my req.body.address into the following query. the address data have json value.
here my code
here my request data,
the sql table row,
That is the error,
Your mysql library is probably, by default, applying a standard string conversion to req.body.address. When you do this to a javascript object you obtain [object Object]:
req.body.address.toString() // "[object Object]"
Objects needs to be converted to string using JSON.stringify():
"user_address": JSON.stringify(req.body.address)
You need to save as string in user_address field.
eg:
If you want to save as address like this:
user_address: `${req.body.address.street},${req.body.address.district},${req.body.address.city}`
Or
user_address: JSON.stringify(req.body.address)
whenever you want to show the address you need to do JSON.parse(user_address).
In nutshell, value must be a single value.

JSON Queries - Failed to execute

So, I am trying to execute a query using ArcGIS API, but it should match any Json queries. I am kind of new to this query format, so I am pretty sure I must be missing something, but I can't figure out what it is.
This page allows for testing queries on the database before I actually implement them in my code. Features in this database have several fields, including OBJECTID and Identificatie. I would like to, for example, select the feature where Identificatie = 1. If I enter this in the Where field though (Identificatie = 1) an error Failed to execute appears. This happens for every field, except for OBJECTID. Querying where OBJECTID = 1 returns the correct results. I am obviously doing something wrong, but I don't get it why OBJECTID does work here. A brief explanation (or a link to a page documenting queries for JSON, which I haven't found), would be appreciated!
Identificatie, along with most other fields in the service you're using, is a string field. Therefore, you need to use single quotes in your WHERE clause:
Identificatie = '1'
Or to get one that actually exists:
Identificatie = '1714100000729432'
OBJECTID = 1 works without quotes because it's a numeric field.
Here's a link to the correct query. And here's a link to the query with all output fields included.

Getting Error message from linq to entity query.

I keep receiving the error
"LINQ to Entities does not recognize the method 'System.String get_Item(Int32)' method, and this method cannot be translated into a store expression"
on the following line in my code
var Reviewer = repository.reviewers.FirstOrDefault(t => t.ReviewerName == formCollection[3]);
formCollection[3] is a string returned from a drop down I have contained within a form. The query seems to work O.K. until it returns the value from the database. What can I do to fix this?
OK, I was trying to do too much at once, when I finally thought about it and put formCollection[3] into a string variable and then used the string variable in the linq query everything worked out ok.