Skip to content

Searching for other value types than strings #43

Open
@derwaldgeist

Description

@derwaldgeist

First of all: I really like this package, it helps a lot to implement search functionality.

Today, I tried to set-up a search that uses an array of strings instead of a plain string as an input parameter. This did not work. Instead, I got the following error message:

I20151106-13:55:32.616(1)? Exception while invoking method 'search.source' Error: Match error: Failed Match.OneOf or Match.Optional validation
I20151106-13:55:32.616(1)?     at checkSubtree (packages/check/match.js:244:1)
I20151106-13:55:32.616(1)?     at check (packages/check/match.js:32:1)
I20151106-13:55:32.617(1)?     at [object Object].Meteor.methods.search.source (packages/meteorhacks:search-source/lib/server.js:12:1)
I20151106-13:55:32.617(1)?     at [object Object].methodMap.(anonymous function) (packages/meteorhacks:kadira/lib/hijack/wrap_session.js:164:1)
I20151106-13:55:32.617(1)?     at packages/check/match.js:109:1
I20151106-13:55:32.617(1)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20151106-13:55:32.617(1)?     at Object.Match._failIfArgumentsAreNotAllChecked (packages/check/match.js:108:1)
I20151106-13:55:32.617(1)?     at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1614:1)
I20151106-13:55:32.617(1)?     at packages/ddp/livedata_server.js:648:1
I20151106-13:55:32.617(1)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20151106-13:55:32.617(1)? Sanitized and reported to the client as: Match failed [400]
I20151106-13:55:32.617(1)? 

Is there any particular reason why the input parameter is limited to a string? I will now concat the array using a delimiter character as a work-around, but it would be nicer if I could send arrays or plain objects directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions