2 ms·
I'm also working on a noSQL database. What I'm struggling with is the abstraction for searches/filters. For example, if you want to get all books with "beginner
by z3t4 12y ago
I'm also working on a noSQL database. What I'm struggling with is the abstraction for searches/filters. For example, if you want to get all books with "beginner" in the title, in SQL it would look something like:
"SELECT * FROM books WHERE title LIKE %beginner%"
Where in no-SQL it would look like
book.filter({title: ["like", "beginner"]});
Any ideas on how to abstract the filtering in a more clear way?
- dkersten 12y agoIn RethinkDB the query looks like this: r.table('books').filter(function(doc){ return doc('title').match("beginner") }) Or like this: r.table('books').filter(r.doc('title').match("beginner")) Or if you have a secondary index setup correctly, this could work: r.table('books').getAll("beginner", {index: "title"})