Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation fix #160

Open
stevenhaab opened this issue Jul 22, 2019 · 3 comments
Open

documentation fix #160

stevenhaab opened this issue Jul 22, 2019 · 3 comments

Comments

@stevenhaab
Copy link

On "Working with Data", the .sum() example is showing .last("balance"). It should say .sum('balance')

For .get() I wonder if it's examples got deleted. It's probably amazing, but I have no idea how to use it. Can I use it to select a subset of records in an ordered result?

For .start(), adding "The first record is 1, not 0".

I cannot figure out how to return the 2nd, or 3rd or 4th record in an ordered. I only want 1 result so I .limit(1) and if I want the 2nd record, I set .start(2) but I get 0 results.
Adding documentation of how to do it correctly, would help me.

And by the way, this taffydb is wonderful.

@stevenhaab
Copy link
Author

Another thing in the documentation that I find confusing: I want to remove some records from the query object, and all I can find is db().remove(). But it says it will remove from the database, not a resulting query object. Is there a command to .omit or .exclude from a query object?
It seems to be, if it's going permanently delete records from a database, it should be db.remove() and not db().remove(). I'm afraid to test this. db().remove() is in the Query Object methods section. Is it in the wrong section, or is the documentation wrong?

@stevenhaab
Copy link
Author

The db().filter() , the documentation mentions Functions. An example would be helpful. I'm wondering if it is like .each() and does it call the function for each record in the query object? Does return false; omit a record from the query object result?

Is there a command that will convert a Query object result, into a new database under a new name, which I would consider using if db().remove() can only remove records from a database.

@stevenhaab
Copy link
Author

Adding a section to define words, would be helpful. "collection" is confusing. Sometimes it's data in localStorage, other times is a Query Object, and it can be the whole database.

db().order("col1 desc").filter( function() { // test true or false }); Seems to apply the filter function to the original data, before ".order", unfortunately. If I wanted the original data, I could put the function in db( function() {// test true or false }).order("col1 desc"); Is there a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant