nosql

How should I model my MongoDB collection for nested documents?

痞子三分冷 提交于 2019-12-10 11:45:11
问题 I'm managing a MongoDB database for a building products store. The most immediate collection is products, right? There are quite several products, however they all belong to one among a set of 5-8 categories and then to one subcatefory among a small set of subcategories. For example: -Electrical *Wires p1 p2 .. *Tools p5 pn .. *Sockets p11 p23 .. -Plumber *Pipes .. *Tools .. PVC .. I will use Angular at web site client side to show whole products catalog, I think about AJAX for querying the

Programmatically creating edges in ArangoDB

痞子三分冷 提交于 2019-12-10 11:21:43
问题 What is the simplest way to quickly create edges in ArangoDB programmatically? I would like to create relationships between documents based on a common attribute. I'd like to be able to select an attribute, and for every document in collection A, create an edge to every document in collection B that has the same value in an equivalent attribute. For example, if I've imported email messages into a collection and people into another collection, I would like to generate edges between the emails

MongoDB Table Design and Query Performance

╄→尐↘猪︶ㄣ 提交于 2019-12-10 11:12:15
问题 I'm new to MongoDB. When creating a new table a question came to my mind related to how to design it and performance. My table structure looks this way: { "name" : string, "data" : { "data1" : "xxx", "data2" : "yyy", "data3" : "zzz", .... } } The "data" field could grow until it reaches an amount of 100.000 elements ( "data100.000" : "aaaXXX"). However the number of rows in this table would be under control (between 500 and 1000). This table will be accessed many times in my application and I

Remove indexes that are in nested field when deleting an object

夙愿已清 提交于 2019-12-10 11:07:23
问题 I'm still on Firebase and this time I have a question related on the deletion of objects. I have a structure like the following: users: { UsErId1:{ name: "Jack", email: "m@i.l" }, UsErId2: { + }, UsErId3: { + } }, user_contacts: { UsErId1:{ UsErId2: true, UsErId3: true }, UsErId2: { UsErId1: true } } So if I want to delete an user I have to: Delete the user object Delete the user object under the user_contacts branch Remove all the indexes from user_contacts that are pointing to that user My

Riak: are links dissolved if the target is deleted?

穿精又带淫゛_ 提交于 2019-12-10 10:47:08
问题 When an item is deleted from a store are links automatically deleted from all of the documents linking to the now missing item? Or do we have a situation that's similar to a broken link on an HTML page? 回答1: No, links are not deleted automatically. Links are just a metadata stored with objects so to find all objects which link to a deleted object you need to traverse the whole database which is not reasonable. 来源: https://stackoverflow.com/questions/5113264/riak-are-links-dissolved-if-the

which diagram to use in NoSql (Mcd, Merise, UML)

随声附和 提交于 2019-12-10 10:40:00
问题 again, sorry for my silly question, but it seems that what i've learned from Relation Database should be "erased", there is no joins, so how the hell will i draw use Merise and UML in NoSql? http://en.wikipedia.org/wiki/Class_diagram this one will not work for NoSql? 回答1: How you organize your project is an independent notion of the technology used for persistence; In particular; UML or ERD or any such tool doesn't particularly apply to relational databases any more than it does to document

calculate frequency using mongodb aggregate framework

[亡魂溺海] 提交于 2019-12-10 10:34:38
问题 I'm trying to calculate frequency of documents in my db based on 10 seconds intervals. this is how my database objects look like: [ { created_at: "2014-03-31T22:30:48.000Z", id: 450762158586880000, _id: "5339ec9808eb125965f2eae1" }, { created_at: "2014-03-31T22:30:48.000Z", id: 450762160407597060, _id: "5339ec9808eb125965f2eae2" }, { created_at: "2014-03-31T22:30:49.000Z", id: 450762163482017800, _id: "5339ec9908eb125965f2eae3" }, { created_at: "2014-03-31T22:30:49.000Z", id:

Use NoSQL in MySQL

青春壹個敷衍的年華 提交于 2019-12-10 10:27:07
问题 I've noticed MySQL could use Memcached NoSQL with InnoDB but I can't retrieve information about how to use it. I want to use with PHP. Are NoSQL queries standard? 回答1: First of all, MySQL only support memcached with NoSQL since version 5.6. Today this version it's not update yet in linux repositories and must be manually installed, specially in servers, e.g. MySQL --version (ubuntu) is 5.5.38 ; (RedHat server) 5.1 You also must install libevent-dev e.g: Still some hacks are needed, and you

Techniques in dealing with Eventual Consistency of the Datastore

偶尔善良 提交于 2019-12-10 10:23:25
问题 How does existing persistence framework for the GAE, like Objectify , Datanucleus , Twig , etc. deal with the "eventual consistent" nature of the datastore? I'm working with the datastore in the DatastoreService layer (I'm not using such persistence framework right now). During my unit test I get the correct count of object sometimes and sometimes not. Which is expected. This is my JUnit helper configuration: private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new

How to synchronize changes in nosql db (ravendb)

南楼画角 提交于 2019-12-10 10:19:55
问题 I've started learning NoSQL on an example of RavenDB. I've started with a simplest model, let's say we have topics that were created by users: public class Topic { public string Id { get; protected set; } public string Title { get; set; } public string Text { get; set; } public DenormalizedUser User { get; set; } } public class DenormalizedUser { public string Id { get; set; } public string Name { get; set; } } public class User { public string Id { get; protected set; } public string Name {