FAQ Database Discussion Community


Does a bucket span over all nodes in a Couchbase Server cluster?

nosql,views,couchbase,couchbase-bucket
I've been reading through the Couchbase Server documentation, and as I understand it, this is "how it all works": A cluster has one or more nodes (servers). A cluster has one or more buckets. A bucket has one or more views. My questions: I would assume that the data in...

IndexedDB: retrieve the out-of-line key associated with a particular object in an object store

javascript,nosql,indexeddb,persistent-object-store
Say I have an object store, which was created like this: IDBDatabase.createObjectStore(Name, {autoIncrement: true }); Now, say I retrieve an object from that object store using an index to look it up. Is there a way that I can retrieve the out-of-line key associated with the object so I can...

NoSQL quorum comparing to virtual sharding

cassandra,nosql,replication,sharding,horizontal-scaling
After reading about few NoSQL techniques it looks for me that Quorum fails comparing with Virtual Sharding. Virtual sharding allow scalability and does not increase amount of read/writes across a system. What's also bad that I absolutely can't find any benefit of quorum over sharding. Question: May you act as...

Developing a search and tag heavy website

sql,database,web-applications,solr,nosql
I'm in the planning phase of developing a very tag heavy website. Everything will essentially be associated with tags and the entire site would be based on searching these tags. Now, I've been thinking a lot about going the nosql route here, since from what I read and understand, it...

mongoDB query with case insensitive schema element

mongodb,nosql
In my MongoDB collection I have added a record as follows db.teacher.insert({_id:1 ,"name":"Kaushik"}) If I search db.teacher.find({name:"Kaushik"}) I get one record. But if I try "NAME" instead of "name" i.e. db.teacher.find({NAME:"Kaushik"}) It won't return any record. It means that I must know how schema element is spelled exactly with exact...

Get aggregate sum of json array in Postgres NOSQL json data

json,postgresql,nosql
How to get aggregate SUM(amount) from "refunds" array in postgres json select Following is my data schema and structure: Table Name: transactions Column name: data { "id": "tran_6ac25129951962e99f28fa488993", "amount": 1200, "origin_amount": 3900, "status": "partial_refunded", "description": "Subscription#sub_a67d59efb2bcbf73485a ", "livemode": false, "refunds": [ { "id": "refund_ee4192ffb6d2caa490a1", "amount": 1200, "status": "refunded", "created_at": 1426412340,...

I need a Cassandra Flume Sink

cassandra,nosql,flume,flume-ng
I am trying to find a template/sample of a Cassandra flume sink. I have looked online, and the two projects I have found on github have outdated dependencies (JARs), and I cant find those artifcats anywhere :(. Thanks! looking forward for any refs. ...

Filtered Query in Elastic Search

elasticsearch,nosql
Filtered Query query not working in elastic search. It gives a error Query Parsing exception with filter malformed, no field after start_object { "query": { "filtered": { "query": { "match_all": {} }, "filter": { "bool": { "must": [], "should": [ { "_expires": null }, { "_expires": { "gte": 1433947304884 }...

Cassandra connections keep increasing

cassandra,nosql
My application's connection with cassandra keep increasing, MaxConnectionsPerHost doesn't work. i'm windering why? Here's my configration. Builder builder = Cluster.builder(); builder.withRetryPolicy(DefaultRetryPolicy.INSTANCE); // JMX 配置 builder.withoutJMXReporting().withoutMetrics(); //DCAwareRoundRobinPolicy dCAwareRoundRobinPolicy = new DCAwareRoundRobinPolicy("DC1", 2); builder.withLoadBalancingPolicy(new RoundRobinPolicy()); // 添加节点 for (String host : this.agentHosts) { builder.addContactPoints(host); }...

ElasticSearch filtering on multiple fields (with aggregration)

json,elasticsearch,nosql,facet
I am building a faceted filtering function for a webshop, something like this: Filter on Brand: [ ] LG (10) [ ] Apple (5) [ ] HTC (3) Filter on OS: [ ] Android 4 (11) [ ] Android 5 (2) [ ] IOS (5) I am using aggregation and...

Elasticsearch Aggregation by Day of Week and Hour of Day

elasticsearch,nosql,elasticsearch-plugin,spring-data-elasticsearch,pyelasticsearch
I have documents of type: [{"msg":"hello", date: "some-date"},{"msg":"hi!", date: "some-date"}, ... I want to have the count of documents by day of week. For example x messages were sent on Monday and y were sent on Tuesday and so on. I have used date_histogram with aggregation but it returns me...

Mongodb: Finding and updating object property from array

mongodb,nosql,mongodb-query,mongodb-update
I have a collection with multiple documents which follow this structure: { "_id" : { "oid" : XXX }, "name" : "Name", "videos" [ { "id" : 1, "thumbnail" : "thumbnail.jpg", "name" : "Name here" }, { "id" : 2, "thumbnail" : "thumbnail.jpg", "name" : "Name here" }, { "id"...

Marklogic|NodeJS API - Query on attribute of a field

node.js,nosql,marklogic
I have a json structure something like { foo:"bar", keyPhrases:[ {key: "random thing", value: 5}, {key: "another random", value: 3} ] } How can i do a word query on keyPhrases.key ? I tried qb.word('keyPhrases.key', 'random') or qb.word(qb.property('keyPhrases.key'), 'random') and it does not work. Any ideas? I know this is...

How to store and continously calculate the rolling average of data points

python,nosql
I'm about to develop a quota tracking tool, that needs to account the number of events each user has triggered the last 60 minutes. I'm free to choose storage method (rdbms, nosql, memory, whatever), and pretty much anything else, but it should accessible to multiple nodes over the network. I've...

Saving Model in Mongoose fails to save nested component

mongodb,mongoose,nosql
I have the following model schema: var memberSchema = mongoose.Schema({ 'project' : { 'type' : Schema.Types.ObjectId, 'ref' : 'Project' }, 'first' : String, 'last' : String, 'email' : String, 'tracker' : { 'etag' : String, 'id' : String, 'photoLink' : String, 'role' : String, 'type' : String, }, 'survey' :...

Is there a way of using JavaScript libraries in Azure DocumentDB server code?

javascript,azure,stored-procedures,nosql,azure-documentdb
I'm writing some trigger code in Azure DocumentDB. Is there a way of using/referencing JavaScript libraries (such as underscore) within server Stored Procedures, Triggers and User Defined Functions? Thanks...

MarkLogic - Use PojoQueryBuilder to do a 'like' search

nosql,marklogic
Say I have a JSON saved in ML8 as : { "com.marklogic.poc.java.api.pojos.ProviderJSON": { "providerId": "1111", "name": "John Doe", "age": "41", "gender": "M" } } I have tried doing searches using following methods to search whole json or any specific attribute: term word value But if i want to find if...

How does nesting structures affect DocumentDB query performance?

database,data-structures,nosql,query-performance,azure-documentdb
The question might otherwise be stated as "to flatten or not to flatten?" If I were to store nested JSON documents in a DocumentDB collection, would querying across those nested structures perform on par with having stored those nested structures in a separate collection as flat documents on their own?...

Fastest way to store and retrieve arrays

python,sql,arrays,database,nosql
I'm working on a project where I have to store about 17 million 128-dimensional integer arrays e.g [1, 2, 1, 0, ..., 2, 6, 4] and I'm trying to figure out what's the best way to do it. The perfect solution would be one that makes it fast to both...

Example How to represent table from RDBMS to HBase

hadoop,nosql,hbase
I read few articles and videos on YouTube about HBase. I understood that HBase is hadoop database. And it has different architecture (like column group etc.) compared to RDBMs. But I am still not clear how a RDBMs table will be represented in HBase? Let me know if there is...

How do I model multiple “many to many” relationships in Cassandra?

cassandra,nosql,schema
I've been reading up on Cassandra, I've done some tutorials and played around with CQL but now that it is time for me to design a schema I'm having some difficulty. I'm trying to create a schema that will handle the following use case. I need to keep track of...

How to measure performance of databases in Java?

java,database,performance,nosql,jmh
I'm looking for a good way to measure the performance of particular databases in Java and compare them with each other. The databases are: (NoSQL) MongoDB, CouchDB and Cassandra as well as (RDBMS) MySQL, Postgresql. I'm planning to do some CRUD tests and some more complexer joins/relations tests. I thought...

Best storage option for temporary data

nosql,relational-database,storage
In the context of an application I am developing I need to store quite a good amount of data for limited amount of time - think of the scenario in terms of object buckets - for a certain limited amount of time objects are in some buckets then they move...

Using partition key along with secondary index

cassandra,nosql,bigdata,cassandra-2.0
Following are the two queries that I need to perform. select * from where dept = 100 and emp_id = 1; select * from where dept = 100 and name = 'One'; Which of the below options is better ? Option 1: Use secondary index along with a partition key....

Cassandra Titan create own DB

database,cassandra,nosql,titan
I am starting with titan and i am really loosing in it. I created my own graph databse model with tables(Vertices) and relations(Edge). Well, now I want to create my DB, but I cannot find any good tutorial. How to build scripts? Do you have same example how to create...

When using a database that is supposedly thread-safe, do I need to synchronize my own threads?

python,multithreading,concurrency,nosql,rethinkdb
I'm writing a Python application that uses a Rethink database. I have three worker threads that need to run and possibly access the database at the same time. I know how to synchronize threads in Python, but my question is: do I need to? If Rethink claims to be thread-safe,...

NoSQL, ElasticSearch or even old school relational database?

elasticsearch,nosql,db2
we have an application that stores records of events in a DB2 database. And we have users that query these events, based on the time of the events, and optional some ids as search criteria. The data is only once written, no updates on these records. The query has no...

ArangoDb get latest document from all collections

nosql,arangodb,aql
I'm beginning to think I've modeled my data a bit incorrectly, since I'm having trouble querying it. Currently what I have is a bunch of Customers (modeled as a Database per customer) These Customers have a bunch of Devices: Device1...n (modeled as a collection per device) These devices generate messages...

Data Integrity importance when taking the NOSQL approach ?

mongodb,nosql,database-schema,software-engineering,data-integrity
I almost done working on a big application, a couple days ago i saw martin fowler talk on NOSQL, after that i realize that i have been using mongo as a relational db, so i decided to refactor my schema, but i have heard a lot about integrity, from a...

Memtable understanding

cassandra,nosql,cassandra-2.0
I have some questions about cassandra memtable. I'll be grateful for the help. Facts about memtable: 1) placed in RAM; 2) per-ColumnFamily structure; 3) multiple memtables may exist for a single column family; Questions: 1) When additional memtable for column family are created? What condition is need? I assume that...

mongodb Single Point of Failure

database,mongodb,nosql
I am aware that mongodb has a master-slave architecture. Therefore, I was thinking that the master would be the single point of failure in mongoDB since it takes care of all the requests and sends it to the slave nodes. However, when the master fails, then a new master is...

How to find documents with unique values in MongoDB?

node.js,mongodb,mongoose,nosql
I have a collection with several documents in it of jobs to process using another system. I look up 5 objects from this table like this: Work.find({status: 'new'}) .sort({priority: 'desc'}) .limit(5) .exec(function (err, work){}) There is another field on these documents which determines that only one job with a given...

Map keys to emit function

javascript,object,mapreduce,nosql,couchdb
i've got an object in couchDB and in this looks like are several arrays, im new to couchDB and i don't know how to access the keys of it. The document looks like this: { "_id": "113232", "_rev": "1-c967a81c0eccba6a7c92e3c4b352d4eb", "name": "Ezequiel Campion", "vorlesungen": [ { "Ethik": 1.7 }, { "Glaube...

Using Mongoid: Can you use embed_in in multiple documents at the same time?

ruby,mongodb,nosql,mongoid,relationship
I'm getting use to using Mongoid, however I ran into this problem with a situation where I'm trying to use Mongoid. I have a game, the game has teams, the teams have players, and the game has the same players. class Game include Mongoid::Document embeds_many :Players embeds_many :Teams end class...

Cannot establish a connection to orientdb using jdbc driver?

netbeans,jdbc,nosql,orient-db
I'm newbie to the orientdb, I'm using netbeans's (add new connection wizard) to add a connection to the orientdb, I used orientdb-jdbc-2.0.2-all.jar as a jdbc driver, but I got the following error after clicking on test connection Snapshot of the error I made sure that the database is connected and...

CouchDB Compression

mysql,nosql,compression,couchdb
I have a MySQL database that I wanted to store on an external 4TB drive, but when I copied the database over to it, the server failed to restart. I found out it had something to do with a sector size issue. This gave me reason to make the jump...

Cassandra: Missing column in query results

java,cassandra,nosql
Here's a strange one. I've got a Cassandra table, call it, "test". It has several columns. These are queried via the Java driver, with a simple "select * from test where uuid=foo". This works locally, all columns are returned. In production environment, however, one column is dropped, despite it having...

MongoDB BsonDocument size limit

mongodb,nosql,bson
I'm experimenting with MongoDB for a pet project. The domain model doesn't necessarily suit relational more than no-sql (as far as I'm aware), so it seemed like a good candidate to learn with. The JSON representation of my model would look something like this: { "_id": someId, "prop1": "foo", "prop2":...

Load Multiple types of Documents at Once

nosql,ravendb
I have two separate document types public class One { public int Id { get;set; } public string Name { get;set; } } public class Two { public int Id { get;set; } public string Name { get;set; } } I have a second object that holds a reference to...

How to setup Tables in DynamoDB to be able to query a string set/List?

nosql,amazon-dynamodb
Currently, I have a table in DynamoDB with this schema: ID : PostID (Hash Key) Location : LocationID (Range Key) Tags: List of strings Now I want to be able to query the Tags list and for each item in the table and find which Posts have those tags. How...

Does the term NoSQL fit inside a DBMS?

database,nosql,rdbms
According to wikipedia, a Database Management System consists of four main types: 1 Hierarchical DBMS 2 Network DBMS 3 Relational DBMS 4 Object-oriented DBMS I was wondering whether the term NoSQL is also a type of DBMS. If it does not, where does it belong to? Or can't it be...

What's read-before-write in NoSQL?

apache,cassandra,nosql
I wrote in a book : Cassandra is an NOSQL database and promotes read-before-write instead of relational model. I didn't understand read-before-write in NoSQL ! ANY HELP THANKS ! ...

NoSQL database. In CAP theorem, what does CP mean?

database,nosql,cap
I am confused about the difference between CA and CP. Suppose that we choose CP,and there is a partition in the network, if we want to keep consistency in the distributed system, every node has to wait and get synchronized to prevent there is inconsistency. For example, we have 10...

Distinct/Aggregation query Mongodb array, trim trailing space

arrays,mongodb,nosql,nosql-aggregation
I have a MongoDB collection which contains a colours array like : myCollection : { _id : ..., "colours" : [ { "colourpercentage" : "42", "colourname" : "Blue" }, { "colourpercentage" : "32", "colourname" : "Red" }, { "colourpercentage" : "10", "colourname" : "Green " } ] } I would...

mongo group and count with condition

javascript,mongodb,nosql
I'm trying to group a set of documents and count them based on their value. For example { "_id" : 1, "item" : "abc1", "value" : "1" } { "_id" : 2, "item" : "abc1", "value" : "1" } { "_id" : 3, "item" : "abc1", "value" : "11" }...

PouchDB structure

nosql,couchdb,pouchdb
i am new with nosql concept, so when i start to learn PouchDB, i found this conversion chart. My confusion is, how PouchDB handle if lets say i have multiple table, does it mean that i need to create multiple databases? Because from my understanding in pouchdb a database can...

How to select where sum of fields is greater than a value in MongoDB

mongodb,nosql,mongodb-query,nosql-aggregation
Using MongoDB, How would I write this regular SQL statement? SELECT * FROM table WHERE (field1+field2+field3) > 1 I've been messing with $group, $project, $add, etc. I feel like I'm dancing all around the solution but can't figure it out....

How to ensure memory consumption is not scaling with the size of the redis database

mysql,memory,redis,nosql,jedis
I am currently using Jedis for fetching my data from redis database server. I need to push this data on to MySQL. The redis server has millions of records in it. Using the below statements I can copy the data in to a set: String pattern = "users*";//All keys starting...

couchDB - how to display more than key/value?

jquery,json,nosql,couchdb,cloudant
I'm utterly stuck in my RDBMS ways of thinking and having one heck of a time going through limited tutorials and guides to get my head around noSQL I created a database bookmarks in cloudant and created two documents like this: { "_id": "3d609bd2689639afc2520f17d8f4c883", "_rev": "2-7227c3e1350f2d4f67f62f830b3f331e", "title": "bing homepage", "url...

How to add another field in a join sails js

javascript,mongodb,nosql,sails.js
Hey all just getting started with Sails js and mongoDB and im a bit confused. I have two models with a many-to-many relationship: User.js module.exports = { attributes: { username: 'STRING', password: 'STRING', doors:{ collection: 'door', via: 'users', } } }; and Door.js module.exports = { attributes: { name: 'STRING',...

how data is stored in distributed databases. In apache cassandra it is equally stored. How will it be the case in other distributed dbms's?

cassandra,nosql,distributed-database
I had read articles in DataStax about Apache Cassandra and I had noticed that whatever the data we are going to write is going to distributed among all the nodes equally. Is it will be the case in all other distributed database management systems? Will other systems distribute the data...

Cloud vs NoSQL for scalable web applications [closed]

azure,cassandra,nosql,cloud,scalability
I want to have some basic understanding of the following. In order to build a scalable web application, what are the options they have ? What is the difference among the following 1) simply using noSQL databases(like Cassandra) for scalability 2) Using cloud services (like Azure, Openstack) for scalability 3)...

Cassandra CQL driver implementation

java,cassandra,nosql,cql,drivers
I have used Cassandra CQL driver to implement some module. I know CQL driver works on port 9042.My module is working fine on port 9042 for cassandra servers(tried both local and remote). However due to some constraints on the data center port 9042 is not open for Cassandra. I need...

DocumentDb - get Json representation of Document

c#,azure,nosql,azure-documentdb
Is there a simple/any solution for putting JSON representation of Document data (without DocDb native properties like _rid etc.) into response (in stored procedures) or is there a solution somewhere in Microsoft.Azure.Documents namespace?

How to get maximum element from a table from DynamoDb AWS Console?

json,amazon-web-services,nosql,amazon-dynamodb
I am trying to create a database table in NoSQL in order to be able to retrieve the element with a maximum value in one of its columns. Suppose the SQL schema looks like this: Table_Page PageId: int(10) - PK Name: varbinary(255) RevisionId: int(10) - FK Table_Revision RevisionId: int(10) -...

DocumentDB find deep key:value

nosql,azure-documentdb
in MongoDB I can perform a find on any deep level key like collection.find('persons.age': 12) Is a similar thing possible with document DB? I have tried something like the following which fails with: code":"BadRequest" - could not be resolved. query: "SELECT * FROM root WHERE person.age = 12" ...

Recommended way to “join” dynamodb table with reference table

nosql,amazon-dynamodb
Let's say I got a table in dynamodb called visits which represents websites visits and one of the columns is the location. In an RDBMS I would have: visits [id, website_id, ........, location_id ] ref_locations [id, city, country, postcode, lat, long] The query we want to do is get me...

MongoDB: query nested array by more than one condition

mongodb,nosql
Say this is one item from my users collection: { "_id" : "5545f4c4d0dd52c355a99fbe", "name" : "Dollie James", "device" : "iOS", "gender" : "Female", "wallet" : [ { "store" : "All Saints", "balance" : "$196.11", "date" : "2014-02-22T22:09:38 -10:00", "tags" : [ "Tshirt", "Summer" ] }, { "store" : "Nike", "balance"...

How should I store tag hierarchy data in DB for fast retrieval of hierarchy chains?

sql-server,mongodb,database-design,data-structures,nosql
The data I am dealing with is a hierarchy of tags which are strings and more than writes we would be performing reads. We would be searching for a tag, and for whichever tag the search string is a sub string, we would need to return its full hierarchy with...

MariaDB Dynamic Column Nesting

nosql,mariadb
I have been searching for this for a couple of hours. I have setup a MariaDB server and am implementing Dynamic Columns, which I know how to do, but I can't seem to find out how to go more than one level deep. INSERT INTO Invoices (Invoice) VALUES ( COLUMN_CREATE...

How to find data in mongoose?

node.js,mongodb,mongoose,nosql
I tried this command but it doesnt have an output. I want to find the formatted_address with the Iligan City, Lanao del Norte, Philippines. Postjob.find({'location.results[2].formatted_address': 'Iligan City, Lanao del Norte, Philippines'}) { "user": ObjectId("5557411628f66792558f60d3"), "created": ISODate("2015-05-16T15:06:15.478Z"), "map": { "zoom": "3", "position": "8.22992420109622,124.24962043762207" }, "location": { "status": "OK", "results": [ {...

Querying with “contains” on a list of user defined type (UDT)

cassandra,nosql,apache-spark,cassandra-2.1
For data model like: create type city ( name text, code int ); create table user ( id uuid, name text, cities list<FROZEN<city>>, primary key ( id ) ); create index user_city_index on user(cities); Querying as select id, cities from user where cities contains {name:'My City', code: 10}; is working...

Azure DocumentDB Query Performance: ID vs SelfLink

azure,nosql,azure-documentdb
I'm aware that the DocumentDB team is working on an update to the service that will allow access & querying of documents, collections and databases with the user given ID versus having to use the service generated SelfLink. I am very enthusiastic about this update and based on conversations at...

I'm trying to import an external Redis database (.RDB file) on a Redis installation on Windows but the new data is not being loaded?

database,import,redis,nosql
I have been trying for hours to import a .RDB Redis database file into a new installation on my local machine. I have followed all the steps on Stackoverflow stating to basically drop the dump.rdb into the installation folder (i.e. what it's condifured to read in the .conf file. See...

Dynamodb data model for process/transaction monitoring

nosql,data-modeling,amazon-dynamodb
I am wanting to keep track of multi stage processing job. Likely just need the following fields batchId (guid) | eventId (guid) | statusId (int) | timestamp | message (string) There are relatively small number of events per batch. I want to be able to easily query events that have...

Cassandra+nodejs: how to get the Keyspaces and Tables?

node.js,cassandra,nosql
I am trying to get the metadata, keyspaces, tables from a Cassandra Cluster. I am using the following node.js code: var express = require('express'); var bodyParser = require('body-parser'); var cassandra = require('cassandra-driver'); var client = new cassandra.Client( { contactPoints : [ '127.0.0.1' ] } ); client.connect(function(err, result) { console.log('Connected To...

How to write query to my Cloudant database?

nosql,bluemix,cloudant
I am trying to achieve the right query for my NoSQL database, but I am confused how to do it in Cloudant. In SQL with be SELECT * FROM mydb WHERE user_permit_doc_id = 10 AND user_tracking_id = 1 My query is like: https://293e2cb7-3561-4004-a1c3-58d54f517ee6-bluemix.cloudant.com/user_files/_design/user_tracking/_view/new-view?startkey=["user_permit_doc_id:10"] and it returns all of the docs,...

BsonClassMap Serializer' is not configurable using an attribute of type 'BsonRepresentation Attribute'

c#,mongodb,nosql,document,bson
I am a beginner in mongodb. I have a hierarchial models in mongo, Please see my code below. public class Technology { public Technology() { ProductGroups = new List<ProductGroup>().ToArray(); } [BsonRepresentation(BsonType.ObjectId)] public ObjectId _id { get; set; } public string Name { get; set; } [BsonRepresentation(BsonType.Array)] public ProductGroup[] ProductGroups {...

Low TTL with Leveled Compaction, should I reduce gc_grace_seconds to improve read performance without impacting delete replication?

java,database,nosql,cassandra-2.0
Low TTL with Leveled Compaction, should I reduce gc_grace_seconds to improve read performance? Scenario: Cassandra Table to cache an external db values - read performance needs to be good (less than 100ms) TTL = 4 hrs at row level Functional full table refresh (delete and then lazy load) every 6...

Which maxmemory policies allow expiration in Redis?

redis,nosql,ttl
Which maxmemory policies are compatible with redis expiration mechanisms? Is it only volatile-ttl? Does noeviction stop old records from death?...

NoSql beginner dude. Data design and relationships

database,design,nosql
I have many doubts NoSQL concepts. I can understand how NoSQL data store, but do not understand how to deduce the best way and how to distribute the data. For example, a data store. How to store the orders? Option A: customers: [customer {data1, data2,..., orders: [{data1, products [{data1, data2,...

Does the size of a document affect performance of a find() query?

database,node.js,mongodb,nosql,database-performance
Can the size of a MongoDB document affect the performance of a find() query? I'm running the following query on a collection, in the MongoDB shell r.find({_id:ObjectId("5552966b380c2dbc29472755")}) The entire document is 3MB. When I run this query the operation takes about 8 seconds to perform. The document has a "salaries"...

ArangoDB custom sort order

mysql,nosql,arangodb,aql
I would like to sort by a field in a specific order, lets say 2,4,1,5,3. In MySQL I could use ORDER BY FIELD(id,2,4,1,5,3). Is there anything equivalent for ArangoDB?...

NoSQL statistics type query with BaasBox - OrientDB 1.7.10

nosql,orient-db,baasbox
I'm trying out BaasBox v0.9.2 which ships with OrientDB 1.7.10 for a proof of concept web app I want to build. Premise is fairly simple and adding/querying is very straight forward and simple for single collections. What I'm having difficulty trying to visualize is how to get statistics type information...

Fetch distinct record based on values for that record with MongoDB

mongodb,nosql,sails.js,sails-mongo
I have collection of restaurant record .Some of restaurant in this collection belongs to some group(chain type restaurant eg. KfC etc) while other doesn't has any group(Individual restaurant ,that doesn't belongs to any chain). example : Restaurant collections {_id:"1",title:"rest1",address:"somethingx",chain_id:"123"}, {_id:"2",title:"rest2",address:"somethingx",chain_id:"123"}, {_id:"3",title:"rest3",address:"somethingy",chain_id:"0"}, {_id:"4",title:"rest4",address:"somethingx",chain_id:"0"} Chain collection :...

MongoDB - is this query possibile with denormalized model?

mongodb,nosql,mongodb-query
I have this simple Mongodb document: { "_id" : ObjectId("55663d9361cfa81a5c48d54f") "name" : "Oliver", "surname" : "Queen", "age" : 25, "friends" : [ { "name" : "Jhon", "surname" : "Diggle", "age" : "30" }, { "name" : "Barry", "surname" : "Allen", "age" : "24" } ] } Is it possbile, using...

How can I store a backgammon board in MongoDB?

mongodb,database-design,nosql
I am new to NoSQL databases, and even though I've looked for it a lot, I cannot find best practices for this sort of thing. Backgammon, for those of you who don't know, is a game with a board that has twenty four pips (or slots), and a bar which...

Cassandra default column value cqlsh

cassandra,nosql,cqlsh
I am very new to Cassandra, and using the cqlsh to try out basic queries. I want to alter a table by inserting a new column with a default value (say 0). This is same as this SO question, the difference being I am trying to do it from cqlsh,...

Create relation with existing nodes Cypher Neo4j

d3.js,neo4j,nosql,graph-databases
I am creating a relationship graph with unique Source's hashtag. I am wondering that is every time I have to check if source or target is already exists after creating nodes first time? If I use Merge when source is exists but target is new then merge failed to create...

Database/Code solutions for model with dynamic data, using Symfony 2 with Doctrine

database,symfony2,model,doctrine,nosql
I'm making an application with Symfony2 and Doctrine and i'm facing a problem i've always wondered about but it's never been an issue until today: How to handle dynamic data? In the application i'm developing there will be some data that might be relational and to which a relational database...

DynamoDB Secondary Index on Multi-Value Type

database-design,nosql,amazon-dynamodb
I have a table that has a hash key of type Number and an attribute that is a multi-value set of numbers. Assume the hash key is a group_id and the multi-value set is a set of members of that group (user_ids) I want to be able to query Which...

Mongodb: Query with a field value, but also another unknown unique field

database,mongodb,geolocation,nosql
Lets say my documents are this format(random data): {"_id" : 30, "lat": 36.1212111, "lon" : 120.2312112 "uuid" : 123123123} {"_id" : 31, "lat": 36.1212111, "lon" : 120.2345112 "uuid" : 123123123} {"_id" : 32, "lat": 36.1212111, "lon" : 120.2378112 "uuid" : 123123123} {"_id" : 33, "lat": 36.1212111, "lon" : 120.2378112 "uuid"...

Can one grep the whole database?

mongodb,nosql,mongodb-query
I have a database with some collections. I want to find all documents from any collection that contain particular string in any of their field. As currently I need it only for debug purposes, I can think of a solution that involves dumping everything with mongodump and searching those files...

Cassandra CQL3 conditional insert/update

cassandra,nosql,conditional,updates,cql3
I have a list of unordered events and my task is to store first and last occurrences for them. I have following column family in Cassandra: CREATE TABLE events ( event_name TEXT, first_occurrence BIGINT, last_occurrence BIGINT, PRIMARY KEY (event_name) ); So if I have an event with the name "some_event"...

mongodb find and replace efficient way to run query

regex,mongodb,nosql,mongodb-query
I have the following query to find   tags in name field and replace them with empty space. (to get rid of them) Name string can have 1 to many   tags eg - AA&nbsp;aa AA&nbsp;&nbsp;aa AA&nbsp;&nbsp;&nbsp;aa AA&nbsp;&nbsp;&nbsp;&nbsp;aa AA&nbsp;AA&nbsp;aaaaaaaalike that db.tests.find({'name':/.*&nbsp;.*/}).forEach(function(test){ test.name = test.name.replace("&nbsp;",""); db.tests.save(test); }); db.tests.find({'name':/.*&nbsp;&nbsp;.*/}).forEach(function(test){...

What are the advantages of using a label instead of an attribute in a graph database?

graph,neo4j,nosql
I am learning graph databases using Neo4J and my first approach to categorize my nodes was creating an attribute type in all nodes. After some research, I found that I can use labels to categorize the nodes, but I did not found if there is an advantage of using labels...

Retrieve distinct values from the hash key - DynamoDB

python,nosql,amazon-dynamodb,boto
I have a dynamodb table to store email attribute information. I have a hash key on the email, range key on timestamp(number). The initial idea for using email as hash key is to query all emails by per email. But one thing I trying to do is retrieve all email...

NOSQL document relation

nosql,pouchdb
i try to understand how pouchdb work, i am new with nosql. Every tutorial on internet seems too basic so i can't really understand . I have two JSON document . One of them is to keep the static record, value of this document will be inserted into every new...

Riak Cluster Backup

database,nosql,riak
We have a five node Riak cluster(n_val is 3) running on Amazon EC2 spread across multiple availability zones. Since we don't have enterprise edition, we do not have the luxury of multi datacenter replication and a full sync to a different zone/region. Our current backup strategy is this: SSH to...

Issues with loading dump file in to redis database

database,redis,nosql,dump,data-migration
I have a dump.rdb file that is obtained from another redis server. I am trying to load this dump file in to my redis database but was unsuccessful. Here are the sequence of steps I performed: stop redis on my machine sudo /etc/init.d/redis_6379 stop copy dump file on to system...

ArangoDB Query for a certain number of matches to an Array

nosql,arangodb,aql
In ArangoDB I have a document with a field for storing "tokens". A token is an array of int values. Eg: token: [0] = 5000 [1] = 250 [2] = 300 etc... A token may have up to about 50 of these values. I want to query for documents who...

REST API status as integer or as string?

json,string,api,rest,nosql
Me and my colleague are working on REST API. We've been arguing quite a lot whether status of a resource/item should be a string or an integer---we both need to read, understand and modify this resource (using separate applications). As this is a very general subject, google did not help...

Without scale-out, does NoSQL have better performance than MySQL?

nosql
I have a single machine for setting up a database. The main purpose of that database is to write/write audit log. The write/read ratio is about 9:1. Originally I planed to use MySQL. Later I heard of NoSQL DB have better performance on when "scale out". I am interested if...

NoSQL DB for searching in vector space

vector,redis,cassandra,nosql,distance
I am completely new to NoSQL DBS such as Cassandra, Mongo, Redis, etc. and I want to create this type of a structure : { "item_id": "ABC1", "x1": 0.55, "x2": -0.29, ... "x100": 0.17 } Basically, I have millions of items and 100 floats associated with each of them. My...

what is the difference between bulk insert and array insert in Mongo db operations

mongodb,nosql
I am wondering how following queries varies in performance. I understand that bulk insert executes in sequence and normal/array inserts also executes in sequence. BULK INSERT var bulk = db.items.initializeUnorderedBulkOp(); bulk.insert( { _id: 1, item: "abc123", status: "A", soldQty: 5000 } ); bulk.insert( { _id: 2, item: "abc456", status: "A",...

RavenDB count index including zero values

c#,mapreduce,nosql,ravendb
I have a list of items {Id, Name, CategoryId} and a list of categories {Id, Name, IsActive}. How to get a list {CategoryId, Count} including categories that have zero items. Currently I have such index: public class CategoryCountIndex : AbstractIndexCreationTask<Item, CategoryCountIndex.Result> { public class Result { public string CategoryId {...

Is NoSQL ideal for my use case

sql,nosql
One of our customer is in manufacturing domain. He has multiple factories across the country. For the quality control, he is using window application deployed independently in all factories (approx 100 in count). Our customer is interested in replacing all the window applications with a single web application. Now the...

Modeling and publishing a follower-based feed with Meteor

database,mongodb,meteor,nosql,meteor-publications
I'm working on a simple app where a User can follow other users. Users can star posts. And a user's feed is composed of posts that have been starred by users they follow. Pretty simple actually. However, this all gets complicated in Mongo and Meteor... There are basically two way...

Columns and rows in casandra datastax opscenter

windows,cassandra,nosql,opscenter
I have just started learing the cassandra. I am using datastax opscenter. I am able to create columnfamily, but could not able to find to add the columns and rows in columnfamily through opscenter, though I am able to do on cqlsh. Please advise Thanks...

Conditional $inc in MongoDB query

database,mongodb,nosql,increment
I have a survey system with documents like this: { "_id" : ObjectId("555b0b33ed26911e080102c4"), "question" : "survey", "subtitle" : "", "answers" : [ { "title" : "option 1", "color" : "#FFEC00", "code" : "opt1", "_id" : ObjectId("555b0b33ed26911e080102ce"), "votes" : 0, "visible" : true }, { "title" : "option 2", "color" :...