LockerProject/Locker — pull request #445 by smurthas (2011-11-15 23:24:43+00:00)
Title: Fixes for #435

Added to logic to properly retrieve fields from the "encounters" mongo collection as specified by {"encounters.*":1/0} in the fields param. Also, always pull link field out of the DB as it is used for deduping and delete it from the object before returning if it wasn't requested.

As this alters an API, it felt better to do a pull req instead of just pushing right into master. Could I ask a 2 people to check it out, look at the code, and make sure it works in the way they would expect? There is stilla bit of strange thing in that you can set full=true and fields={"encounters":0} and you will get the encounters back - it would be an easy fix, but that would be a not-necessarily expected change, so I left it out for now.