-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
106 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// var col = liteDb.GetCollection<LiveProject>("LiveProject"); | ||
|
||
// var colall = liteDb.GetCollection<LiveProject>("LiveProject"); | ||
// var all = colall.FindAll().Where(pr => pr.Tracks.Any(tr => tr.Plugins.Any(pl => pl.Value.Name.ToLower() == "decapitator"))).ToList(); | ||
|
||
// // var pluginsList = pluginsToLocate | ||
|
||
// // var q1 = col.Find(proj => proj.Tracks != null && proj.Tracks.Any(track => track.Plugins != null && track | ||
// // .Plugins.Any(plugin => pluginsToLocate.Contains(plugin.Key)) | ||
// // )).ToList(); | ||
|
||
// var q1 = col.Query().Where(proj => proj.Name == "Industrial Acid Techno Youtube.als"); | ||
// // var col1 = q1.Select(x => x); | ||
// var col1 = q1.First(); | ||
|
||
// // var proj = col1.First(); | ||
|
||
// var a = q1.Where(x => x.Tracks.Where(x => x.Plugins != null && x.Plugins.Count > 0).Any()).Select(x => x).ToList(); | ||
|
||
|
||
// // var b = col.Query().Where(x => x.Tracks.Where(x => x.Plugins != null && x.Plugins.Any(p => p.Value.Name == "Decapitator")).Any()).Select(x => x).ToList(); | ||
// // {LiteDB.LiteException: Any/All requires simple parameter on left side. Eg: `x => x.Phones.Select(p => p.Number).Any(n => n > 5)` | ||
|
||
// // var b = col.Query().Where(x => x.Tracks.Where(x => x.Plugins != null && x.Plugins.Keys.Any(k => k.Equals("Decapitator"))).Any()).Select(x => x).ToList(); | ||
// // var b = col.Query().Where(x => x.Tracks.Where(x => x.Plugins.Where(p => p.Value.Name == "Decapitator").Count() > 0).Any()).Select(x => x).ToList(); | ||
// var c = col | ||
// .Query() | ||
// .Where(proj => proj.Name == "Industrial Acid Techno Youtube.als") | ||
// .Where(x => x.Tracks.Where(x => x.Plugins.Values.Where(v => v.Name.Length > 5).Count() > 0).Count() > 0) | ||
// .Select(x => x) | ||
// .ToList(); | ||
|
||
// var q1 = col.Find(proj => proj.Tracks.Count > 40) | ||
// .Select(x => x.Tracks) | ||
// .ToList(); | ||
|
||
// var q2 = col.FindAll().ToList(); | ||
|
||
// var q3 = col.Query().Select(x => x).ToList(); | ||
|
||
|
||
|
||
// var p1 = col | ||
// .Query() | ||
// .Where(proj => proj.Tracks.Any(track => track.Name.Length > 10)) | ||
// .Select(proj => proj) | ||
// .ToList(); | ||
|
||
// var projects = col | ||
// .Query() | ||
// .Where(proj => proj | ||
// .Tracks.Any(track => track | ||
// .Plugins.Any(plugin => pluginsToLocate.Contains(plugin.Key)) | ||
// ) | ||
// ) | ||
// .Select(proj => proj) | ||
// .ToEnumerable(); | ||
|
||
//return null; | ||
|
||
// var projects1 = col | ||
// .Query() | ||
// .Where(proj => proj.Plugins != null && proj.Plugins.Any(k => pluginsToLocate.Any(x => k.Name.Contains(x, StringComparison.InvariantCultureIgnoreCase)))) | ||
// .Select(p => p) | ||
// .ToEnumerable(); | ||
|
||
// var projects2 = col | ||
// .Query() | ||
// .Where(proj => proj.Plugins.Where(plugin => pluginsToLocate.Contains(plugin.Name)).Any()) | ||
// .Select(p => p) | ||
// .ToEnumerable(); | ||
|
||
// var projects3 = col | ||
// .Query() | ||
// .Where(proj => | ||
// proj.Plugins.Where(plugin => | ||
// pluginsToLocate.Any(p => p.Contains(plugin.Name, StringComparison.InvariantCultureIgnoreCase)) | ||
// ).Any() | ||
// ) | ||
// .Select(p => p) | ||
// .ToEnumerable(); | ||
|
||
// var projects4 = col | ||
// .Include(x => x.Plugins) | ||
// .FindAll() | ||
// .Where(p => p.Plugins.Intersect(pluginsToLocate)) | ||
|
||
// var pluginToLocate = pluginsToLocate[0]; | ||
// var col = liteDb.GetCollection<LiveProject>("LiveProject"); | ||
|
||
// var query = @"SELECT { $.*, $.Plugins[*] FROM LiveProject } WHERE $.Plugins[*].Title LIKE '%" + pluginToLocate + "%'"; | ||
// var s = liteDb.Execute(query).ToList(); | ||
|
||
// var res = col.Query() | ||
// .Where(proj => proj.Plugins.Any(p => p.Key.Contains(pluginToLocate, StringComparison.InvariantCultureIgnoreCase)).Any()) | ||
// .Select(x => x); | ||
|
||
// return res.ToEnumerable(); | ||
|
||
// return null; |