示例#1
0
        public IEnumerable <Watch> GetSomeData(ConnectionMongoDB connection, int skip, int limit)
        {
            IMongoCollection <Watch> collection = connection.DB.GetCollection <Watch>(collectionName);
            var filter  = new BsonDocument();
            var watches = collection.Find(filter).Skip(skip).Limit(limit).ToList();

            return(watches);
        }
示例#2
0
        public IEnumerable <Watch> GetData(ConnectionMongoDB connection)
        {
            IMongoCollection <Watch> collection = connection.DB.GetCollection <Watch>(collectionName);
            var filter  = new BsonDocument();
            var watches = collection.Find(filter).ToList();

            return(watches);
        }
示例#3
0
        public void Add(ConnectionMongoDB connection, SubscribeUser user)
        {
            IMongoCollection <SubscribeUser> collection = connection.DB.GetCollection <SubscribeUser>(collectionName);

            collection.InsertOne(user);
        }
示例#4
0
 public SubscribeUsers(ISubscribeContex _contex)
 {
     contex     = _contex;
     connection = new ConnectionMongoDB(connectionDB, dbName);
 }
示例#5
0
 public Watches(IWatchContex _contex)
 {
     contex     = _contex;
     connection = new ConnectionMongoDB(connectionDB, dbName);
 }