コード例 #1
0
        public void GetFromMongoTest()
        {
            var parser = new FilterParser();

            var result = parser.Parse(this.jobj);
//            var result = parser.Parse(jobj0);
//            var result = parser.Parse(jobj1);
//            var result = parser.Parse(jobj2);
//            var result = parser.Parse(jobj3);

            var builder = new MongoFilterBuilder <BsonDocument>();

            var text = result.GetQueryLanguageString();

            result.ConvertIdToMasterId();

            var mongoDataProvider = new MongoDataProvider("mongodb://demo.mongo1.domination.win:27017/masterdb_db9e00fa_1e68_4663_9bc2_93c7d7794b17");
            var collection        = mongoDataProvider.GetCollection <BsonDocument>("transactions");

            var documentsFinder = builder.RenderQuery(result, collection);

            var documents = documentsFinder.ToList();


            var q = new QueryLanguageBuilder().RenderQuery(result);
        }
コード例 #2
0
        public List <JObject> GetTransactions(string dataProviderKey, SingleQuery singleQuery)
        {
            var builder = new MongoFilterBuilder <BsonDocument>();

            // Add "Deleted" filter
            singleQuery.NodesList
            .First
            .AddCriteria(CriteriaAppendType.And, ObjectHelper.DeletePropName, CriteriaComparator.NotEq, true);

            var transactionsCollection =
                this.dataProviderPool.GetProvider(dataProviderKey).GetCollection <BsonDocument>(this.CollectionName);

            var documentsFinder = builder.RenderQuery(singleQuery, transactionsCollection);

            var documents = documentsFinder.ToList();

            var jobjects = documents.DeserializeToJObject();

            return(jobjects);
        }