0.4.4 • Published 3 years ago
fireferret v0.4.4
FireFerret
Autocaching query client for MongoDB, with powerful filtering functionality.
We care about response times!
References
What? | Where? |
---|---|
API-Documentation | https://mster.github.io/fireferret/ |
Client Config | https://mster.github.io/fireferret/Options.html#.FireFerretOptions |
Source code | https://github.com/mster/fireferret |
MongoDB | https://www.mongodb.com/ |
Redis | https://redis.io/ |
Requirements
FireFerret requires MongoDB and Redis instances.
Usage
const FireFerret = require("fireferret");
const ferret = new FireFerret({
mongo: { uri: "...", collectionName: "..." },
redis: { host: "...", port: 6379, auth_pass: "..." },
});
await ferret.connect();
const docs = await ferret.fetch({ "some.field": /.*/ });
Query some documents using pagination.
const docs = await ferret.fetch(
{ genre: { $in: ["Djent", "Math Metal"] } },
{ pagination: { page: 3, size: 20 } }
);
FireFerret supports streaming queries.
await ferret.fetch({ isOpen: true }, { stream: true }).pipe(res);
Using the Wide-Match strategy.
const smartFerret = new FireFerret({
/* ... ,*/
wideMatch: true,
});
await smartFerret.connect();
const query = { candidates: { $ne: "Drumpf", $exists: true } };
/* cache miss */
const first50docs = await smartFerret.fetch(query, {
pagination: { page: 1, size: 50 },
});
/* cache hit */
const first20docs = await smartFerret.fetch(query, {
pagination: { page: 1, size: 20 },
});
/* cache hit */
const first10docs = await smartFerret.fetch(query, {
pagination: { page: 1, size: 10 },
});
/* cache hit */
const firstDoc = await smartFerret.fetchOne(query);
Contributing
We welcome you with open arms. Contributions are appreciated after v1.0.0
- Huge thanks to Andrew Richtmyer for creating the FireFerret 'Pabu' artwork.
0.4.4
3 years ago
0.4.3
3 years ago
0.4.2
4 years ago
0.4.0
4 years ago
0.3.6
4 years ago
0.3.5
4 years ago
0.3.4
4 years ago
0.3.3
4 years ago
0.3.2
4 years ago
0.3.1
4 years ago
0.3.0
4 years ago
0.2.8
4 years ago
0.2.7
4 years ago
0.2.5
4 years ago
0.2.3
4 years ago
0.2.2
4 years ago
0.2.4
4 years ago
0.2.1
4 years ago
0.2.0
4 years ago
0.1.0
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1-alpha-10
4 years ago
0.0.1-alpha-9
4 years ago
0.0.1-alpha-8
4 years ago
0.0.1-alpha-7
4 years ago
0.0.1-alpha-6
4 years ago
0.0.1-alpha-5
4 years ago
0.0.1-alpha-4
4 years ago
0.0.1-alpha-3
4 years ago
0.0.1-alpha-2
4 years ago
0.0.1-alpha-1
4 years ago
0.0.0
4 years ago