Skip to content

Can't remove one of multiple models #2

@dereksweet

Description

@dereksweet

Hello. Thanks so much for the component. Am having an issue using the remove() method however. It works fine when I only have one of a model stored, but once I add two or more an error is thrown upon the call to remove().

For example if I store one record to /book/1 and then call MyModel.remove('/book/1'), it works just fine. However if I store one record to /book/1, and another record to /book/2, and THEN try and call MyModel.remove('/book/1') it throws the following error:

2017-04-16 01:41:42.721 [error][tid:com.facebook.react.AsyncLocalStorageQueue][RCTConvert.m:58] JSON value '(
    "/book/2"
)' of type NSMutableArray cannot be converted to NSString
2017-04-16 01:41:42.729 [error][tid:com.facebook.react.AsyncLocalStorageQueue][RCTUtils.m:395] 
Error: {
    message = "Entries must be arrays of the form [key: string, value: string], got: (\n    \"[\\\"/book/2\\\"]\"\n)";
}

Other than this the component works absolutely perfectly for my needs so I hope I am just doing something wrong or it's an easy fix. Let me know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions