Comments (6)
Which spits out object:
{ where: { world: 17 }, order: { zone: 1 }, limit: 50, skip: null }
Which is then accepted by Mongo and processed using their typehinted object FindManyOptions
, fully supporting pagination etc. My intent is we treat it basically how we'd treat any mongo instance.
from api.
That is a proprietary format. A normal format based on the example would be:
GET /some/endpoint/1234?filter[instance]=10-37435&filter[facility][gt]=7000&sort[timeStarted]=1
But if you start looking at such flexibility I would seriously start considering grapQL.
Also considering that most instance collections(except maybe deads) will be around ~1000 records I think sorting can be done locally easily.
from api.
I'm not sure how I feel about passing in json strings as a query. I've never seen it implemented like that.
from api.
That is a proprietary form
It's not, it's literally what you pass to mongo compass, essentially we're mocking exactly that object literal into the query, parsing it, then passing it to the mongo platform to pull out via the API. We're also declaring against the where
calls directly so it presumably won't be open to any kind of injection.
I'm not sure how I feel about passing in json strings as a query. I've never seen it implemented like that.
It'll be up to the client implementation to parse it as a URL encoded string, which I've seen many times, and is pretty safe unless you're using weird things like emoji.
Example:
GET http://dev.api.ps2alerts.com/instances/territory-control?filter=%7B%22world%22%3A17%7D&sort=%7B%22zone%22%3A%201%7D
aka
GET http://dev.api.ps2alerts.com/instances/territory-control?filter={"world":17}&sort={"zone": 1}
Will return a ascending sorted array of territory control alerts from Emerald.
from api.
I would be very careful with it and have some strict validation in place. But it is still a proprietary form, not as much as how we use it internally but definitely seen from the client server communication. I don't like it, but I won't object.
from api.
Superceded by #64 .
from api.
Related Issues (20)
- Create instance facility control time history
- Create mechanism to process Global Aggregates after alert has finished
- Add population endpoint
- Transition API module to Contabo Cluster
- Add internal endpoints for Aggregator use
- Add Census data replacement for Map Lattices
- Global Victory Aggregate taking 2+ seconds to respond
- Add PlayerFacilityCapture / Defense support
- Create healthcheck endpoint HOT 1
- KPM / DPM handling
- Bracket calculations require a delay HOT 2
- GainExperience processing and endpoints
- Outfitwars support HOT 2
- Create a new API endpoint for the purposes of searching Players and Outfits based on an input
- Alert Redrive project
- Time Played metrics don't recognise that the player has left
- Handling for new Weapon Data from aggregator
- Create vehicle data endpoint HOT 1
- Database index issues HOT 1
- Create mechanism to calculate bracket based off population HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api.