fordth / jinqJs

jinqJs provides a simple way to perform SQL like queries on javaScript arrays, collections and web services using LINQ expressions.
Other
93 stars 29 forks source link

.delete().at() does not really clear the data #18

Closed pemn closed 7 years ago

pemn commented 8 years ago

When i use .delete().at() to clear the entire database, it appears to work. If i do a .select(), it returns a empty array. So far, so good. But if i try to insert new data with a new .from(data_array), the new data gets appended to the old data which was suposed to be deleted. The old and the new data are returned by .select() which before the .from() showed a empty list. I looked in the code and the collections private variable is never cleared, and the new data is added with .push(). The only way i found to really clear the table was using .join([]);. It works, but its a quirky workaround. I am not sure if this is working as intended and im doing something wrong or its something that can be improved.

fordth commented 8 years ago

Pemn, thank you for the detailed info. I will take a look.

fordth commented 7 years ago

This has been addressed in release version 1.6.1. Thank you!