-
-
Notifications
You must be signed in to change notification settings - Fork 721
Description
I have a array objects like this
[
{
"id": 1,
"name": "Abc Def",
"semester": 1,
"fees": "Paid"
},
{
"id": 2,
"name": "Qwe Rty",
"semester": 3,
"fees": "Pending"
},
{
"id": 3,
"name": "Qwe Rty",
"semester": 3,
"fees": "Pending"
}
]
When I try to use it as a api, it auto converts it to a object and adds a key to each object. How do I even read this?
My students.json array is converted to a object with keys(numbers increamented).
What do I do to get the array instead of a object, how do I access a specific object say student 2 or object 2
from my array.
How do I query this data, like only
or where
and sortBy
, is it also possible to paginate the data (my array of students, eventually it will be crossing 200 students with each object containing more details)
I tried adding querying with only
like this http://localhost:3000/api/students?only=title
it responds with empty object
I might be trying to use it the wrong way, but this would solve me a lot of problems, like instead of using a Headless CMS via its api, everything will be handled locally