4
23
Fork
You've already forked jsdb
3

is() queries do not match strings (includes() works) #10

Open
opened 2024年01月25日 21:08:41 +01:00 by aral · 0 comments
Owner
Copy link

For example, given:

db.posts = [ { id: '1', foo: 'bar' }, { id: '2', foo: 'baz'} ] 

The following returns an empty array:

db.posts.where('id').is('1')

Whereas the following returns the first element in an array as expected:

db.posts.where('id').includes('1')

is() should work correctly for strings.

For example, given: ```js db.posts = [ { id: '1', foo: 'bar' }, { id: '2', foo: 'baz'} ] ``` The following returns an empty array: ```js db.posts.where('id').is('1') ``` Whereas the following returns the first element in an array as expected: ```js db.posts.where('id').includes('1') ``` `is()` should work correctly for strings.
Sign in to join this conversation.
No Branch/Tag specified
main
types
set-support
better-custom-objects
typed-arrays
cjs
7.0.1
7.0.0
5.1.0
3.0.0
2.0.7
1.2.3
1.2.2
2.0.6
2.0.5
1.2.1
1.2.0
2.0.4
2.0.3
2.0.1
2.0.0
1.1.5
1.1.4
1.1.3
1.1.2
1.1.0
1.1.1
1.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
small-tech/jsdb#10
Reference in a new issue
small-tech/jsdb
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?