nosql

MongoDB: can't convert from BSON type EOO to Date

一笑奈何 提交于 2020-01-23 05:22:32
问题 I' trying to use aggregation framework (with ruby) and project the date like this: db['requests'].aggregate([ {"$project" => { _id: 0, method: '$method', user: '$user', year: {'$year' => '$timestamp'} }}]) the document is like this one: { _id: ObjectId("5177d7d7df26358289da7dfd"), timestamp: ISODate("2013-04-12T03:58:05+00:00"), method: "POST", status: "200", inputsize: "874", outputsize: "4981", user: "131" } but i get the following error: Mongo::OperationFailure: Database command 'aggregate

10个出色的NoSQL数据库

余生颓废 提交于 2020-01-23 00:37:40
虽然NoSQL流行语火起来才短短一年的时间,但是不可否认,现在已经开始了第二代运动。尽管早期的堆栈代码只能算是一种实验,然而现在的系统已经更加的成熟、稳定。不过现在也面临着一个严酷的事实:技术越来越成熟——以至于原来很好的NoSQL数据存储不得不进行重写,也有少数人认为这就是所谓的2.0版本。这里列出一些比较知名的工具,可以为大数据建立快速、可扩展的存储库。 1. Casssandra Cassandra 最初由Facebook开发,后来成了Apache开源项目,它是一个网络社交云计算方面理想的数据库。它集成了其他的流行工具如Solr,现在已经成为一个完全成熟的大型数据存储工具。Cassandra是一个混合型的非关系的数据库,类似于Google的BigTable。其主要功能比Dynomite(分布式的Key-Value存储系统)更丰富,但支持度却不如文档存储MongoDB。Cassandra的主要特点就是它不是一个数据库,而是由一堆数据库节点共同构成的一个分布式网络服务,对Cassandra的一个写操作,会被复制到其他节点上去,而对Cassandra的读操作,也会被路由到某个节点上面去读取。在最近的一次测试中, Netflix建立了一个288个节点的集群 。 2. Lucene/Solr Lucene 是Apache软件基金会4 jakarta项目组的一个子项目

Firestore schema versioning and backward compatibility with android app to prevent crashes

天大地大妈咪最大 提交于 2020-01-22 19:57:42
问题 Firestore a NOSQL is a Document oriented database. Now how to manage versioning of the data as I use it with Firebase SDK and Android applications? For e.g. let's say I have a JSON schema that I launch with my 1.0.0version of my android app. Later 1.0.1 comes up where I have to add some extra fields for the newer documents. Since I changed the structure to have additional information, it only applies to new documents. Therefore, using this logic, I can see my Android application must be able

Does Cassandra support sharding?

℡╲_俬逩灬. 提交于 2020-01-22 13:20:23
问题 Does Apache Cassandra support sharding? Apologize that this question must seem trivial, but I cannot seem to find the answer. I have read that Cassandra was partially modeled after GAE's Big Table which shards on a massive scale. But most of the documentation I'm currently finding on Cassandra seems to imply that Cassandra does not partition data horizontally across multiple machines, but rather supports many many duplicate machines. This would imply that Cassandra is a good fit high

Does Cassandra support sharding?

亡梦爱人 提交于 2020-01-22 13:20:00
问题 Does Apache Cassandra support sharding? Apologize that this question must seem trivial, but I cannot seem to find the answer. I have read that Cassandra was partially modeled after GAE's Big Table which shards on a massive scale. But most of the documentation I'm currently finding on Cassandra seems to imply that Cassandra does not partition data horizontally across multiple machines, but rather supports many many duplicate machines. This would imply that Cassandra is a good fit high

Does Cassandra support sharding?

﹥>﹥吖頭↗ 提交于 2020-01-22 13:19:48
问题 Does Apache Cassandra support sharding? Apologize that this question must seem trivial, but I cannot seem to find the answer. I have read that Cassandra was partially modeled after GAE's Big Table which shards on a massive scale. But most of the documentation I'm currently finding on Cassandra seems to imply that Cassandra does not partition data horizontally across multiple machines, but rather supports many many duplicate machines. This would imply that Cassandra is a good fit high

Many to Many with Mongoose

折月煮酒 提交于 2020-01-22 13:06:14
问题 I have the two models: Item.js const mongoose = require('mongoose'); const itemSchema = new mongoose.Schema({ name: String, stores: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Store' }] }); const Item = mongoose.model('Item', itemSchema); module.exports = Item; Store.js const mongoose = require('mongoose'); const storeSchema = new mongoose.Schema({ name: String, items: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Item' }] }); const Store = mongoose.model('Store', storeSchema); module

Many to Many with Mongoose

无人久伴 提交于 2020-01-22 13:05:32
问题 I have the two models: Item.js const mongoose = require('mongoose'); const itemSchema = new mongoose.Schema({ name: String, stores: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Store' }] }); const Item = mongoose.model('Item', itemSchema); module.exports = Item; Store.js const mongoose = require('mongoose'); const storeSchema = new mongoose.Schema({ name: String, items: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Item' }] }); const Store = mongoose.model('Store', storeSchema); module

Cassandra denormalization datamodel

喜你入骨 提交于 2020-01-22 09:29:33
问题 I read that in nosql (cassandra for instance) data is often stored denormalized. For instance see this SO answer or this website. An example is if you have a column family of employees and departments and you want to execute a query: select * from Emps where Birthdate = '25/04/1975' Then you have to make a column family birthday_Emps and store the ID of each employee as a column. So then you can query the birthday_Emps family for the key '25/04/1975' and instantly get all the ID's of the

How to do basic aggregation with DynamoDB?

时光怂恿深爱的人放手 提交于 2020-01-22 09:05:52
问题 How is aggregation achieved with dynamodb? Mongodb and couchbase have map reduce support. Lets say we are building a tech blog where users can post articles. And say articles can be tagged. user { id : 1235, name : "John", ... } article { id : 789, title: "dynamodb use cases", author : 12345 //userid tags : ["dynamodb","aws","nosql","document database"] } In the user interface we want to show for the current user tags and the respective count. How to achieve the following aggregation? {