惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
D
DataBreaches.Net
C
Check Point Blog
雷峰网
雷峰网
小众软件
小众软件
GbyAI
GbyAI
美团技术团队
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
Jina AI
Jina AI
爱范儿
爱范儿
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美

博客园 - rosanshao

使用sc 命令写脚本 添加和删除服务 简单应用 Win 10激活 couchbase map reduce 笔记,转 Couchbase II( View And Index) Couchbase I SqlIO优化 死锁检测 MemCached 安装笔记 Asp.Net异步编程-使用了异步,性能就提升了吗? Autofac Mvc Webapi注入笔记 Sql Server 2005/2008 SqlCacheDependency查询通知的使用总结 WCF .NET REST调用方式 WCF HelpPage 和自动根据头返回JSON XML .net 4.0 新特性 Linq 并行化处理 IIS 假死状态处理 gmap jQuery插件开发 StatusCode - rosanshao - 博客园
StartWith 测试
rosanshao · 2017-12-25 · via 博客园 - rosanshao
var clientConfiguration = GetConfiguration("couchbase.json");
            ClusterHelper.Initialize(clientConfiguration);
            var bucket = ClusterHelper.GetBucket("flamebucket");
            var bucketManager= bucket.CreateManager();
            bucketManager.CreateN1qlPrimaryIndex(false);
            bucket.Upsert("google:one", new Blog { Id = 1, BlogName = "i 1th blog" });
            bucket.Upsert("google:two", new Blog { Id = 2, BlogName = "i 2th blog" });
            bucket.Upsert("flame:three", new Blog { Id = 3, BlogName = "i 3th blog" });
            bucket.Upsert("ro:four", new Blog { Id = 4, BlogName = "i 4th blog" });
            bucket.Upsert("ro:five", new Blog { Id = 5, BlogName = "i 5th blog" });
            while (true)
            {
                Console.Clear();
                Console.WriteLine("please input google flame ro");
                string keyprefix = Console.ReadLine();
                if (keyprefix.StartsWith("q"))
                {
                    break;
                }
                var query = bucket.CreateQuery("flamedesigndoc", "allkeys", false).StartKey(keyprefix).EndKey(keyprefix+ "\ufff0");
                var result = bucket.Query<Blog>(query);
                
                foreach (var row in result.Rows)
                {
                    Console.WriteLine("   key: "+row.Key);
                    Console.WriteLine("=====id:"+row.Value.Id +" blogName: "+ row.Value.BlogName);
                }
                Console.ReadLine();
            }

           
            Console.Read();