Skip to content

Commit

Permalink
New: $exclude option on query and queryall
Browse files Browse the repository at this point in the history
$exclude to remove JSONPath from result
  • Loading branch information
rzander committed Feb 7, 2018
1 parent 3ad33dc commit 582634f
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 102 deletions.
4 changes: 2 additions & 2 deletions source/jaindb/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public JArray Query()
//string sUri = Microsoft.AspNetCore.Http.Extensions.UriHelper.GetDisplayUrl(Request);
var query = QueryHelpers.ParseQuery(sQuery);

return jDB.query(string.Join(",", query.Where(t => string.IsNullOrEmpty(t.Value)).Select(t => t.Key).ToList()), query.FirstOrDefault(t => t.Key.ToLower() == "$select").Value);
return jDB.query(string.Join(";", query.Where(t => string.IsNullOrEmpty(t.Value)).Select(t => t.Key).ToList()), query.FirstOrDefault(t => t.Key.ToLower() == "$select").Value, query.FirstOrDefault(t => t.Key.ToLower() == "$exclude").Value);
}
return null;
}
Expand All @@ -238,7 +238,7 @@ public JArray QueryAll()
//string sUri = Microsoft.AspNetCore.Http.Extensions.UriHelper.GetDisplayUrl(Request);
var query = QueryHelpers.ParseQuery(sQuery);

return jDB.queryAll(string.Join(",", query.Where(t => string.IsNullOrEmpty(t.Value)).Select(t => t.Key).ToList()), query.FirstOrDefault(t => t.Key.ToLower() == "$select").Value);
return jDB.queryAll(string.Join(";", query.Where(t => string.IsNullOrEmpty(t.Value)).Select(t => t.Key).ToList()), query.FirstOrDefault(t => t.Key.ToLower() == "$select").Value, query.FirstOrDefault(t => t.Key.ToLower() == "$exclude").Value);
}
return null;
}
Expand Down
Loading

0 comments on commit 582634f

Please # to comment.