forked from litedb-org/LiteDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
54 lines (42 loc) · 1.37 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using LiteDB;
namespace LiteDB.Demo
{
public class Program
{
[STAThread]
static void Main(string[] args)
{
var orig = @"C:\Git\LiteDB\LiteDB.Shell\bin\Debug\net40\teste.db";
using (var db = new LiteEngine(orig))
{
var col = db.GetCollectionNames().First();
var tt = db.FindAll(col).ToArray();
var c = db.FindOne("DataObjects_1", Query.EQ("_id", "qyeyeW.1oMJK5"));
Console.WriteLine(c == null);
}
//{
// // reading all database
// foreach (var col in db.GetCollectionNames())
// {
// Console.WriteLine("Collection: " + col);
//
//
// foreach (var doc in db.Find(col, Query.All("Token.LastUsedOn")).Take(10))
// {
// Console.WriteLine(JsonSerializer.Serialize(doc, true));
// // ok
// }
// }
//}
Console.WriteLine("End.");
Console.ReadKey();
}
}
}