query : how to handle nesting in body section of post method
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 237
- PR merge metrics
- No merged PRs in 30d
Description
Hi Team,
I have started using 'needle' recently instead of 'request' module. One of the API call (to select data from database) includes complex input:
- Database model - simple string
- Database input - object or array of objects (with $or, $and operators)
For e.g.
let options = {
json: true,
model: "SampleModel",
_**input: {
$or: [
{ where_field1: 'abc' },
{ where_field2: '123' }
]
}**_
}
'request' was able to handle it properly and fetch the data. But needle gets stuck during the call.
If I pass it a simple object, like shown below, it works.
_**input: { where_field1: 'abc' }**_
How to handle it?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Needle's POST body handling entry point and reproduce issue #302 with the nested $or input, then compare it with the simple object case that works. Check whether the nested object or array is handled differently from the request module; done means the complex input completes successfully without getting stuck.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100