public override void Up()
        {
            var collection = GetCollection("ContinentCodes");
            var document   = new BsonDocument();

            document.AddProperty("code", 999);
            document.AddProperty("value", "AT");
            document.AddProperty("display", "Atlantis");
            collection.InsertOne(document);
        }
示例#2
0
        public override void Up()
        {
            var collection = GetCollection(IlevusTableNames.AdsBalanceTable);
            var document   = new BsonDocument();

            document.AddProperty("Balance", "150.0");

            collection.InsertOne(document);
        }
示例#3
0
        public override void Up()
        {
            var collection = GetCollection("Persons");
            var document   = new BsonDocument();

            document.AddUniqueIdentifier(new Guid("06BFFCF5-DAE9-422A-85AB-F58DE41E86DA"));
            document.AddProperty("Name", "John Doe");

            collection.InsertOne(document);
        }
        public override void Up()
        {
            var collection = GetCollection("Animals");
            var document   = new BsonDocument();

            document.AddUniqueIdentifier(new Guid("2A7B73A8-3C4A-422D-90B4-C73BCF48EBD4"));
            document.AddProperty("Kind", "Cat");

            collection.InsertOne(document);
        }
示例#5
0
        public override void Up()
        {
            var collection = GetCollection(IlevusTableNames.AdsReport);
            var document   = new BsonDocument();

            document.AddProperty("ad_id", "");
            document.AddProperty("date", "");
            document.AddProperty("ad_event", "");
            document.AddProperty("cost", "");

            collection.InsertOne(document);

            /*InsertField("date", "");
            *  InsertField("ad", "");
            *  InsertField("event", "");
            *  InsertField("cost", "");*/

            var filter = Builders <BsonDocument> .Filter;

            collection.DeleteMany(filter.Empty);
        }
        public void AddPropertyFact()
        {
            // Arrange
            var name     = AutoFixture.String();
            var value    = AutoFixture.Int();
            var document = new BsonDocument();

            // Act
            document.AddProperty(name, value);
            var element = document.GetElement(name);

            // Assert
            element.Should().NotBeNull();
            element.Value.Should().Be(value);
        }
示例#7
0
        public override void Up()
        {
            var collection = GetCollection("ilevus_definitions");
            var document   = new BsonDocument();

            /*IlevusDBContext.SystemDefinitions.definitions = "{\"PathAds\" : \"\", " +
             *   "\"AdsMaxSize\" : \"\", " +
             *   "\"CostPerClick_pt_br\" : \"\", " +
             *   "\"CostPerView_pt_br\" : \"\", " +
             *   "\"CostPerClick_en\" : \"\", " +
             *   "\"CostPerView_en\" : \"\", " +
             *   "\"CostPerClick_es\" : \"\", " +
             *   "\"CostPerView_es\" : \"\"}";*/

            //document.AddUniqueIdentifier(ObjectId.GenerateNewId().ToString());
            //document.AddProperty("_id", ObjectId.GenerateNewId());
            document.AddProperty("definitions", "{\"PathAds\" : \"\", \"UrlRetriviedAds\" : \"\", \"AdsMaxSize\" : \"\", \"CostPerClick_pt_br\" : \"0\", \"CostPerView_pt_br\" : \"0\", \"CostPerClick_en\" : \"0\", \"CostPerView_en\" : \"0\", \"CostPerClick_es\" : \"0\", \"CostPerView_es\" : \"0\"}");

            collection.InsertOne(document);
        }
        public override void Up()
        {
            var collection = GetCollection("ilevus_ads_log");
            var document   = new BsonDocument();

            document.AddUniqueIdentifier(new Guid("06BFFCF5-DAE9-422A-85AB-F58DE41E86DA"));
            document.AddProperty("user_id", "");
            document.AddProperty("user_nome", "Administrador");
            document.AddProperty("user_email", "*****@*****.**");
            document.AddProperty("ad_id", "");
            document.AddProperty("status", "Approved");
            document.AddProperty("date", DateTime.Now);

            collection.InsertOne(document);
        }
 /// <summary>
 /// Add the unique identifier to the document.
 /// </summary>
 /// <param name="document">The target document.</param>
 /// <param name="value">An unique identifier value.</param>
 /// <remarks>Id is always a Guid value by convention.</remarks>
 public static void AddUniqueIdentifier(this BsonDocument document, Guid value)
 {
     document.AddProperty("_id", value);
 }
示例#10
0
 protected override void UpgradeDocument(BsonDocument document)
 {
     document.AddProperty("Type", 0);
 }
示例#11
0
 protected override void UpgradeDocument(BsonDocument document)
 {
     document.AddProperty("IsActive", true);
 }