Beispiel #1
0
        public IDynamicTableObject[] all()
        {
            var data = MongoCollection.AsQueryable().ToArray();
            var list = data.Select(s => s as IDictionary <string, object>).ToArray();

            return(MongoDynamicTableObject.CreateList(list, MongoCollection.CollectionNamespace.CollectionName));
        }
Beispiel #2
0
        public IDynamicTableObject get(object id)
        {
            var filter = GetIdFilter(id);
            var data   = MongoCollection.Find(filter).FirstOrDefault();

            return(MongoDynamicTableObject.Create(data as IDictionary <string, object>, MongoCollection.CollectionNamespace.CollectionName));
        }
Beispiel #3
0
        public IDynamicTableObject find(string query)
        {
            var filter = QueryToFilter(query);
            var data   = MongoCollection.Find(filter).FirstOrDefault();

            return(MongoDynamicTableObject.Create(data as IDictionary <string, object>, MongoCollection.CollectionNamespace.CollectionName));
        }
Beispiel #4
0
        public IDynamicTableObject[] findAll(string query)
        {
            var filter = QueryToFilter(query);
            var data   = MongoCollection.Find(filter).ToList();
            var list   = data.Select(s => s as IDictionary <string, object>).ToArray();

            return(MongoDynamicTableObject.CreateList(list, MongoCollection.CollectionNamespace.CollectionName));
        }
Beispiel #5
0
        public IDynamicTableObject[] take(int count)
        {
            var pipline = GetPipline();
            var data    = mongoTable.MongoCollection.Aggregate(pipline.Limit(count)).ToList();
            var list    = data.Select(s => s as IDictionary <string, object>).ToArray();

            return(MongoDynamicTableObject.CreateList(list, mongoTable.MongoCollection.CollectionNamespace.CollectionName));
        }