r-spacex / SpaceX-API

:rocket: Open Source REST API for SpaceX launch, rocket, core, capsule, starlink, launchpad, and landing pad data.
Apache License 2.0
10.45k stars 926 forks source link

allow users to make queries with "id" key along with "_id" #1351

Closed robertfeliciano closed 6 months ago

robertfeliciano commented 6 months ago

As of now users must specify the query field as "_id".

For example, a POST request to /launches/query with this in the body: "query": { "id": "5eb87cdaffd86e000604b32b" }, does not return the specified document. Rather, it returns all the documents in the collection.

Switching the "id" to "_id" works.

Since the data returned to users shows "id", I think giving users the option to request data with "id" in the query field would be nice.