nosql

Dynamodb: query using more than two attributes

人盡茶涼 提交于 2019-12-19 06:34:22
问题 In Dynamodb you need to specify in an index the attributes that can be used for making queries. How can I make a query using more than two attributes? Example using boto. Table.create('users', schema=[ HashKey('id') # defaults to STRING data_type ], throughput={ 'read': 5, 'write': 15, }, global_indexes=[ GlobalAllIndex('FirstnameTimeIndex', parts=[ HashKey('first_name'), RangeKey('creation_date', data_type=NUMBER), ], throughput={ 'read': 1, 'write': 1, }), GlobalAllIndex('LastnameTimeIndex'

Dynamodb: query using more than two attributes

﹥>﹥吖頭↗ 提交于 2019-12-19 06:33:17
问题 In Dynamodb you need to specify in an index the attributes that can be used for making queries. How can I make a query using more than two attributes? Example using boto. Table.create('users', schema=[ HashKey('id') # defaults to STRING data_type ], throughput={ 'read': 5, 'write': 15, }, global_indexes=[ GlobalAllIndex('FirstnameTimeIndex', parts=[ HashKey('first_name'), RangeKey('creation_date', data_type=NUMBER), ], throughput={ 'read': 1, 'write': 1, }), GlobalAllIndex('LastnameTimeIndex'

Structure a NoSQL database for a chat application (using FireBase)

孤街醉人 提交于 2019-12-19 00:59:11
问题 Coming from years of using relational databases, i am trying to develop a pretty basic chat/messaging app using FireBase FireBase uses a NoSQL data structure approach using JSON formatted strings. I did a lot of research in order to understand how to structure the database with performance in mind. I have tried to "denormalize" the structure and ended up with the following: { "chats" : { "1" : { "10" : { "conversationId" : "x123332" }, "17": { "conversationId" : "x124442" } } },

Rails Mongoid fails to authenticate - failed with error 13: “not authorized for query on my_db.my_collection”

亡梦爱人 提交于 2019-12-18 19:07:18
问题 This issue was said to be resolved the latest version of Moped but still happens to me. I have a rails 4.2 app with Mongoid, created a user for a MongoDB DB with readWrite and dbOwner roles, and set auth=true in the mong.conf file. I can perform any actions on the DB with that user credentials using the Mongo shell or a simple Java application using their Mongo driver. However, when trying to authenticate with Mongoid I always get this error: failed with error 13: "not authorized for query on

Best way to store redis keys

社会主义新天地 提交于 2019-12-18 18:32:26
问题 I am using Redis to store some information and detect changes in that information over time (for example, think users and locations). What is the value to using a longer or shorter keyname? Using a longer key is clearer, but is there much cost for memory or performance to using longer keyname? Here are examples: SET L:123456 "<name> <latitude> <longitude> ..." HSET U:987654321 loc 123456 time <epoch> or SET loc:{123456} "<name> <latitude> <longitude> ..." HSET user:{U987654321} loc 123456

Best way to store redis keys

假如想象 提交于 2019-12-18 18:32:16
问题 I am using Redis to store some information and detect changes in that information over time (for example, think users and locations). What is the value to using a longer or shorter keyname? Using a longer key is clearer, but is there much cost for memory or performance to using longer keyname? Here are examples: SET L:123456 "<name> <latitude> <longitude> ..." HSET U:987654321 loc 123456 time <epoch> or SET loc:{123456} "<name> <latitude> <longitude> ..." HSET user:{U987654321} loc 123456

mongo db design of following and feeds, where should I embed?

随声附和 提交于 2019-12-18 13:26:40
问题 I have a basic question about where I should embed a collection of followers/following in a mongo db. It makes sense to have an embedded collection of following in a user object, but does it also make sense to also embed the converse followers collection as well? That would mean I would have to update and embed in the profile record of both the: following embedded list in the follower And the followers embedded list of the followee I can't ensure atomicity on that unless I also somehow keep a

nodeJS学习(7)--- WS开发 NodeJS 项目-节2 <安装&设置&启动 mongodb 数据库++遇到的问题>

懵懂的女人 提交于 2019-12-18 12:45:58
转载: http://www.cnblogs.com/zhongweiv/p/node_mongodb.html 目录 简介 MongoDB安装(windows) MongoDB基本语法和操作入门(mongo.exe客户端操作) 库操作 插入 查询 修改 删除 存储过程 nodejs操作MongoDB 插入 查询 修改 删除 调用存储过程 写在之后... 简介: MongoDB   开源,高性能的NoSQL数据库;支持索引、集群、复制和故障转移、各种语言的驱动程序;高伸缩性;   NoSQL毕竟还处于发展阶段,也有说它的各种问题的: http://coolshell.cn/articles/5826.html   官网地址: http://www.mongodb.org/   API Docs: http://docs.mongodb.org/manual/   node-mongodb-native   mongodb的nodejs驱动;   GitHub地址: https://github.com/mongodb/node-mongodb-native MongoDB安装(windows) : 参考前文 nodeJS学习(7)--- WS开发 NodeJS 项目-节2 <安装&设置&启动 mongodb 数据库++遇到的问题> MongoDB基本语法和操作入门(mongo

AngularFire - How do I query denormalised data?

空扰寡人 提交于 2019-12-18 12:36:20
问题 Ok Im starting out fresh with Firebase. I've read this: https://www.firebase.com/docs/data-structure.html and I've read this: https://www.firebase.com/blog/2013-04-12-denormalizing-is-normal.html So I'm suitably confused as one seems to contradict the other. You can structure your data hierarchically, but if you want it to be scalable then don't. However that's not the actual problem. I have the following structure (please correct me if this is wrong) for a blog engine: "authors" : { "

mongodb best practice: nesting

时光总嘲笑我的痴心妄想 提交于 2019-12-18 12:24:37
问题 Is this example of nesting generally accepted as good or bad practice (and why)? A collection called users: user basic name : value url : value contact email primary : value secondary : value address en-gb address : value city : value state : value postalcode : value country : value es address : value city : value state : value postalcode : value country : value Edit: From the answers in this post I've updated the schema applying the following rules (the data is slightly different from above)