nosql

MongoEngine query list for objects having properties starting with prefixes specified in a list

烂漫一生 提交于 2019-12-22 05:23:28
问题 I need to query Mongo database for elements that have a certain property beginning with any prefix in the list. Now I have a piece of code like this: query = mymodel(terms__term__in=query_terms) and this matches objects that have an item on a list "terms" that has StringField "term" explicitly occurring on a list "query_terms". What I want to achieve is having objects that have an item on a list "terms" that has StringField "term" beginning with any prefix that occurs on a list "query_terms".

MongoDB beginner - to normalize or not to normalize?

家住魔仙堡 提交于 2019-12-22 04:43:00
问题 I'm going to try and make this as straight-forward as I can. Coming from MySQL and thinking in terms of tables, let's use the following example: Let's say that we have a real-estate website and we're displaying a list of houses normally, I'd use the following tables: houses - the real estate asset at hand owners - the owner of the house (one-to-many relationship with houses) agencies - the real-estate broker agency (many-to-many relationship with houses) images - many-to-one relationship with

Modelling a Chat like Application in Firebase

独自空忆成欢 提交于 2019-12-22 04:07:39
问题 I have a Firebase database structuring question. My scenario is close to a chat application. Here are the specifics - users(node storing several users of the app) - id1 name: John - id2 name: Meg - id2 name: Kelly - messages(node storing messages between two users) - message1 from: id1 to: id2 text: '' - message2 from: id3 to: id1 text: '' Now imagine building a conversations view for an individual user. So I want to fetch all messages from that particular user and to that particular user I

Does using NoSQL make sense for a non-distributed system? (trying to understand eventual consistency)

久未见 提交于 2019-12-22 01:29:59
问题 I have been reading and learning about NoSQL and MongoDB, CouchDB, etc, for the last two days, but I still can't tell if this is the right kind of storage for me. What worries me is the eventual consistency thing. Does that type of consistency only kick in when using clusters? (I'm hosting my sites in a single dedicated server, so I don't know if I can benefit from NoSQL) For which kind of applications is OK to have eventual consistency (instead of ACID), and for which ones it isn't? Can you

Understanding mongo db explain

烂漫一生 提交于 2019-12-22 01:13:11
问题 I fired a query and tried to explain it on mongo console and got "isMultiKey" : true, "n" : 8, "nscannedObjects" : 17272, "nscanned" : 17272, "nscannedObjectsAllPlans" : 21836, "nscannedAllPlans" : 21836, "scanAndOrder" : true, "indexOnly" : false, "nYields" : 0, "nChunkSkips" : 0, "millis" : 184, Most of the things are explained in http://www.mongodb.org/display/DOCS/Explain, but I cannot understand what does nscannedObjectsAllPlans, nscannedAllPlans means. Can anyone help? Thanks 回答1:

How to query nested keys in Riak?

故事扮演 提交于 2019-12-22 00:24:48
问题 Say you have added a bucket to Riak like below ( Using riak-php-client ): $myData = '{ "24":{ "1": { "Ryan":{ "email":"chris@test.com", "title":"Boss", "Phone":"555.555.5555", "Fax":"555.555.5555", "Twitter":"@testingtwitter" } } } }'; $data = json_decode($myData, true); $object->setData($myData); $object->store(); } }'; If you want to access the "Twitter" value. What is the correct way to access that key via Riak? 回答1: If you wish to retrieve your object by something other than the key, you

What is the production ready NonSQL database?

独自空忆成欢 提交于 2019-12-22 00:19:34
问题 With the rising of non-sql database usage in high traffic website, I'm interested to use it for my project. Now I've heard several names like Voldermort, MongoDB and CouchDB. But which are among these NonSQL database that is production ready? I've seen the download pages and it seems that none of them is production ready because is not version 1.0 yet. Is there any other names other than these 3 that is recommendable to be used in production? 回答1: I think you need to start out from your

Auto calculating fields in mongodb

删除回忆录丶 提交于 2019-12-21 23:39:00
问题 Let's say there are documents in MongoDB, that look something like this: { "lastDate" : ISODate("2013-14-01T16:38:16.163Z"), "items":[ {"date":ISODate("2013-10-01T16:38:16.163Z")}, {"date":ISODate("2013-11-01T16:38:16.163Z")}, {"date":ISODate("2013-12-01T16:38:16.163Z")}, {"date":ISODate("2013-13-01T16:38:16.163Z")}, {"date":ISODate("2013-14-01T16:38:16.163Z")} ] } Or even like this: { "allAre" : false, "items":[ {"is":true}, {"is":true}, {"is":true}, {"is":false}, {"is":true} ] } The top

Cassandra timeseries datamodel

守給你的承諾、 提交于 2019-12-21 21:00:38
问题 Let assume 10 devices(dev01,dev02,dev03..etc). It send data with some interval time,we collect those data,so our data schema is dev01 :int signalname :string signaltime :date/time[with YY-MM-DD HHMMSS.mm] Extradata :String I want to push data into cassandra ,which way is best to store those data? My Query is Like , 1 Need to retrive device based current day data,or with some date range? 2 5 Device current day data? I am not sure the following way to store data into cassadra is best model

Choosing a NoSQL database for storing events in a CQRS designed application

梦想与她 提交于 2019-12-21 20:37:24
问题 I am looking for a good, up to date and "decision helping" explanation on how to choose a NoSQL database engine for storing all the events in a CQRS designed application. I am currently a newcomer to all things around NoSQL (but learning): please be clear and do not hesitate to explain your point of view in an (almost too much) precise manner. This post may deserve other newcomers like me. This database will: Be able to insert 2 to 10 rows per updates asked by the front view (in my case,