Dummy up the Mongo query format for now

Description

The query that the server-side mod-users module recognises is presently in Mongo's bespoke JSON-based format, e.g. {"username":"river"}. Somewhere in the UI we will need, for now, to wrap single-query terms in some JSON scaffolding.

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Jakub SkoczenDecember 5, 2016 at 9:32 AM

Agree, let's keep this to the bare minimum. We are going to devise a much more flexibile querying solution in .

Mike TaylorDecember 2, 2016 at 1:31 PM

Searching at present is only by exact match on user-name – so river will find a record, but Cristian will not. That is lame, but after chatting with Kurt I have concluded it's not worth trying to fix. It seems that Mongo doesn't have a simple way to match across multiple fields – but I could construct a $or sequence. More importantly, all its searching is exact-match on whole fields, so a search for Cristian would not find the record for Cristian Wolff even if we did match against the full_name field as well as username.

So the best approach is to keep the present search where we just do an exact match on username, and call it done. We'll explain when we do the sprint2/sprint3 demo. Because any Mongo-specific query handling will all get thrown away when we move to PostgreSQL anyway, and then again when we do .

Mike TaylorDecember 2, 2016 at 12:41 PM

This is done – it was pretty trivial. Ugly, but not difficult. If it takes us a while to get done, I could throw together a slightly less dumb version of this, that translates for example jakub or jason into the relevant Mongo JSON – but I hope it won't come to that.

Mike TaylorNovember 25, 2016 at 1:28 PM

Down the line of course we will establish a protocol-level query language which Stripes and all clients will emit and all Okapi modules will consume. That is the work of . But until then, we need this workaround.

Done

Details

Assignee

Reporter

Labels

Priority

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created November 25, 2016 at 1:27 PM
Updated December 5, 2016 at 9:32 AM
Resolved December 2, 2016 at 12:41 PM
TestRail: Cases
TestRail: Runs