public static List <string> GetIds(RethinkDb.Driver.RethinkDB R, RethinkDb.Driver.Net.Connection connection) { Cursor <object> cursor = R.Db(DatabaseName).Table(TableName).Pluck("id").RunCursor <object>(connection); String json = ""; cursor.BufferedItems.ForEach(item => json += item + ",\n"); json = json.TrimEnd(',', '\n'); json = "[" + json + "]"; List <ID> ids = new List <ID>(JsonConvert.DeserializeObject <IEnumerable <ID> >(json)); List <string> _ids = new List <string>(); ids.ForEach(id => _ids.Add(id.id)); return(_ids); }
private List <LogEntry> DoSearch(string query, int limit, RethinkDb.Driver.Net.Connection conn) { var date = DateTime.UtcNow.AddDays(-1); var logs = R.Db(_rethinkDbFactory.GetOptions().Database) .Table("Logs") .OrderBy()[new { index = R.Desc(nameof(LogEntry.Timestamp)) }] .Filter(t => t.CoerceTo("string").Match($"(?i){query}")) .Limit(limit) .RunCursor <LogEntry>(conn); var result = logs.ToList(); logs.Close(); return(result); }
public async Task CreateConnectionAsync() { this.Connection = await RethinkDB.R.Connection().Hostname("rethinkdb-server").Port(28015).Timeout(5).ConnectAsync(); }
public RethinkRepository() { this.Connection = RethinkDB.R.Connection().Hostname("rethinkdb-server").Port(28015).Timeout(5).Connect(); }