before deleting Rules
This commit is contained in:
27
CouchDB/Selectors/CouchQuery.cs
Normal file
27
CouchDB/Selectors/CouchQuery.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CouchDB.Selectors
|
||||
{
|
||||
public class CouchQuery
|
||||
{
|
||||
public static CouchQuery Select => new();
|
||||
|
||||
private readonly List<Equals> equals;
|
||||
protected CouchQuery()
|
||||
{
|
||||
equals = new List<Equals>();
|
||||
}
|
||||
|
||||
public CouchQuery WithEqual(string key, string value)
|
||||
{
|
||||
equals.Add(new Equals(key, value));
|
||||
return this;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var selector = string.Join(",", equals);
|
||||
return $"{{ \"selector\": {selector}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user