コード例 #1
0
ファイル: ExampleTest.cs プロジェクト: raihansazal/LiteDB
 public void Insert(SqlDB db)
 {
     db.Insert("col1", new BsonDocument
     {
         ["name"]   = "John " + Guid.NewGuid(),
         ["active"] = false
     });
 }
コード例 #2
0
 public void Insert(SqlDB db)
 {
     db.Insert("col1", new BsonDocument
     {
         ["name"]   = "John " + Guid.NewGuid(),
         ["r"]      = "-".PadLeft(rnd.Next(6500, 19500), '-'),
         ["t"]      = 0,
         ["active"] = false
     });;
 }
コード例 #3
0
        /// <summary>
        /// Use this method to initialize your stress test.
        /// You can drop existing collection, load initial data and run checkpoint before finish
        /// </summary>
        public override void OnInit(SqlDB db)
        {
            db.Insert("col1", new BsonDocument
            {
                ["_id"]  = 1,
                ["name"] = "John"
            });

            //db.ExecuteScalar("CREATE INDEX idx_name ON col1(upper(name))");
        }
コード例 #4
0
ファイル: ExampleTest.cs プロジェクト: raihansazal/LiteDB
        /// <summary>
        /// Use this method to initialize your stress test.
        /// You can drop existing collection, load initial data and run checkpoint before finish
        /// </summary>
        public override void OnInit(SqlDB db)
        {
            db.ExecuteScalar("DROP COLLECTION col1");

            db.Insert("col1", new BsonDocument
            {
                ["_id"]  = 1,
                ["name"] = "John"
            });

            db.ExecuteScalar("CHECKPOINT");
        }