Oracle NoSQL学习的一点心得
来源:互联网 发布:ai设计软件formac 编辑:程序博客网 时间:2024/06/05 12:53
一、无心之谈
项目需要,需要使用Oracle NoSQL数据库,才开始了Oracle NoSQL摸索之旅。
Oracle NoSQL很年轻,目前才更新到3.2.5版本,其功能尚不完全,官方帮助文档简略,尤其是开发API的文档。使得博主在项目进行中尝尝遇到很多问题,又不能很方便的找到解决方案。所以,这些都促使我每次有点收获的时候总想记下来,一方面可以供自己以后学习,另一方面可以供后来人参考.
目前,使用Oracle NoSQL遇到不明白的地方,最好的求助方法就是去官网论坛上发帖,Oracle NoSQL内部人士会热心详细解答,官方论坛
二、一点点心得
1)multiGet() method
2)索引问题
1.Array index
2.multi-Index
3)数据膨胀问题
4)有ChildTable的数据写入问题
5) tableIterator方法与multiGet方法对比
6)范围查询(FieldRange)
Oracle NoSQL DB supports range queries. You could implement regex()-type pattern matching in your client to filter out the rows that you don't want. Regex style and other pattern matching expressions will be supported in the future.
Here's an example of using either the Shard Key within a Primary Key index or using a Secondary Key index to index and fetch a range of values using the KV CLI shell:
exec "create table example1 (ID integer, NAME STRING, Primary Key (NAME))"
put table -name example1 -json '{"ID":1,"NAME":"ABCDEF"}'
put table -name example1 -json '{"ID":2,"NAME":"ABCD"}'
put table -name example1 -json '{"ID":3,"NAME":"ABCDDFR"}'
put table -name example1 -json '{"ID":4,"NAME":"AGRGE"}'
put table -name example1 -json '{"ID":5,"NAME":"DJIJOFKO"}'
put table -name example1 -json '{"ID":6,"NAME":"ABCDLLL"}'
get table -name example1 # non-ordered results of table scan #
{"ID":3,"NAME":"ABCDDFR"}
{"ID":6,"NAME":"ABCDLLL"}
{"ID":2,"NAME":"ABCD"}
{"ID":5,"NAME":"DJIJOFKO"}
{"ID":1,"NAME":"ABCDEF"}
{"ID":4,"NAME":"AGRGE"}
get table -name example1 -field NAME -end "ABCDZ" # Specify the highest value to be returned #
{"ID":1,"NAME":"ABCDEF"}
{"ID":6,"NAME":"ABCDLLL"}
{"ID":2,"NAME":"ABCD"}
{"ID":3,"NAME":"ABCDDFR"}
put table -name example1 -json '{"ID":7,"NAME":"AB"}' # Add another value #
get table -name example1 -field NAME -start "ABCD" -end "ABCDZ" # Specific range of values to be returned #
{"ID":2,"NAME":"ABCD"}
{"ID":3,"NAME":"ABCDDFR"}
{"ID":1,"NAME":"ABCDEF"}
{"ID":6,"NAME":"ABCDLLL"}
Same example, using a Secondary Index:
exec "create table example (ID integer, NAME STRING, Primary Key (ID))"
exec "create index example_idx on example (NAME)"
put table -name example -json '{"ID":1,"NAME":"ABCDEF"}'
put table -name example -json '{"ID":2,"NAME":"ABCD"}'
put table -name example -json '{"ID":3,"NAME":"ABCDDFR"}'
put table -name example -json '{"ID":4,"NAME":"AGRGE"}'
put table -name example -json '{"ID":5,"NAME":"DJIJOFKO"}'
put table -name example -json '{"ID":6,"NAME":"ABCDLLL"}'
get table -name example # non-ordered results of table scan #
{"ID":4,"NAME":"AGRGE"}
{"ID":6,"NAME":"ABCDLLL"}
{"ID":2,"NAME":"ABCD"}
{"ID":5,"NAME":"DJIJOFKO"}
{"ID":3,"NAME":"ABCDDFR"}
{"ID":1,"NAME":"ABCDEF"}
get table -name example -index example_idx # ordered results of secondary index scan #
{"ID":2,"NAME":"ABCD"}
{"ID":3,"NAME":"ABCDDFR"}
{"ID":1,"NAME":"ABCDEF"}
{"ID":6,"NAME":"ABCDLLL"}
{"ID":4,"NAME":"AGRGE"}
{"ID":5,"NAME":"DJIJOFKO"}
get table -name example -index example_idx -field NAME -end "ABCDZ"
{"ID":2,"NAME":"ABCD"}
{"ID":3,"NAME":"ABCDDFR"}
{"ID":1,"NAME":"ABCDEF"}
{"ID":6,"NAME":"ABCDLLL"}
put table -name example -json '{"ID":7,"NAME":"AB"}'
get table -name example -index example_idx -field NAME -start "ABCD" -end "ABCDZ"
{"ID":2,"NAME":"ABCD"}
{"ID":3,"NAME":"ABCDDFR"}
{"ID":1,"NAME":"ABCDEF"}
{"ID":6,"NAME":"ABCDLLL"}
I hope that helps. From the Java API you would use the FieldRange class to specify the start/stop points.
备注:
字母的ascii值:
space(空格)为32;
A为65,此后字母递增;
- Oracle NoSQL学习的一点心得
- 学习的一点心得
- 初学Oracle的一点心得
- SNMP学习的一点心得
- 学习jacob的一点心得
- 学习jacob的一点心得
- 学习jacob的一点心得
- 学习JSP的一点心得
- 学习dsp的一点心得
- 学习Lucene的一点心得
- Web学习的一点心得
- SNMP学习的一点心得
- 学习javascript的一点心得
- 学习QTP的一点心得
- 学习JSP的一点心得
- 学习Photoshop的一点心得
- 学习C#的一点心得
- 学习Vim的一点心得
- WSDL 详解
- Qt5学习笔记(5)——列表框QListWidget类
- OpenStack之RESTful API调用(二)
- 目标检测的图像特征提取之(一)HOG特征
- C++Primer学习笔记(6)语句
- Oracle NoSQL学习的一点心得
- 数据结构--斐波那契数列的非重复递归实现
- 在Unbuntu 14.04中JDK环境的搭建
- Cts框架解析(23)-设备分类
- 关于I/O的一些记录
- 判断一个数是否是质数
- ubuntu安装unix2dos,dos2unix,tofrodos工具
- codeigniter中处理图像
- 《Linux高性能服务器编程》学习笔记——第五章 Linux网络编程基础API(5)