自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

SalmonellaVaccine的专栏

不走弯路,也就错过了风景。无论如何,感谢经历。

  • 博客(33)
  • 收藏
  • 关注

转载 Can’t load kibana on 5601

https://discuss.elastic.co/t/cant-load-kibana-on-5601/41886I have installed Elasticsearch, Logstash, Kibana and Nginx following this guide,https://www.digitalocean.com/community/tutorials/

2016-12-31 09:54:16 1337

转载 MongoDB 模糊查询的三种实现方式-morphia实现

http://gaozzsoft.iteye.com/blog/1561781MongoDB 模糊查询的三种实现方式-morphia实现如下:方式一:正则表达式-单个值模糊查询  Pattern pattern = Pattern.compile("^" + treeIndex + ".*$", Pattern.CASE_INSENSIT

2016-12-30 15:14:57 3651

转载 Express.js Middleware Tutorial

http://qnimate.com/express-js-middleware-tutorial/Developers who are new to Express often get confused with the difference between route handler and middleware. Therefore they also get confused wi

2016-12-30 14:28:37 380

转载 Set CORS on Express API

http://stackoverflow.com/a/21622564/2177408I found the easiest way is to use the node.js package cors. The simplest usage is:var cors = require('cors')var app = express()app.use(cors(

2016-12-30 14:25:53 468

转载 MongoDB regular expression with indexed field

http://stackoverflow.com/questions/8107102/mongodb-regular-expression-with-indexed-fieldQ:I was creating my first app using MongoDB. Created index for a field, and tried a find query with $r

2016-12-28 13:13:29 681

转载 MongoDB随笔3:使用索引

http://www.cnblogs.com/yangecnu/archive/2011/07/19/2110989.html索引索引通常能够极大的提高查询的效率。在系统中使用查询时,应该考虑建立相关的索引。在MongoDB中创建索引相对比较容易。MongoDB中的索引在概念上和大多数关系型数据库如MySQL是一样的。当你在某种情况下需要在MySQL中建立索引,这样

2016-12-28 13:04:12 291

转载 MongoDB索引管理-索引的创建、查看、删除

http://itbilu.com/database/mongo/E1tWQz4_e.html索引是提高查询查询效率最有效的手段。索引是一种特殊的数据结构,索引以易于遍历的形式存储了数据的部分内容(如:一个特定的字段或一组字段值),索引会按一定规则对存储值进行排序,而且索引的存储位置在内存中,所在从索引中检索数据会非常快。如果没有索引,MongoDB必须扫描集合中的每一个文档,这种

2016-12-28 13:02:58 42361

转载 Building Faster APIs with NodeJs and Redis

https://coligo.io/nodejs-api-redis-cache/In this tutorial we will be building an API to compute the total number of stars a GitHub user has across all their public repositories. We'll be using:

2016-12-28 12:54:23 358

转载 Storing nested objects in Redis

https://alexandergugel.svbtle.com/storing-relational-data-in-redisSince Redis supports the usage of a Hash Tables, one dimensional JavaScript-like objects can be modeled it quite easily. The pro

2016-12-27 09:47:28 323

转载 Using Redis with Node.js

https://www.sitepoint.com/using-redis-node-js/Redis is a fast and efficient in-memory key-value store. It is also known as a data structure server, as the keys can contain strings, lists, sets

2016-12-26 13:40:09 317

转载 Can a Compound Index serve multiple queries

http://stackoverflow.com/questions/18698024/can-a-compound-index-serve-multiple-queriesQ:I have a collection by name factories .On this collection there will be two types of queries that

2016-12-25 10:50:36 354

转载 Fuzzy/Partial Search in MongoDB

http://stackoverflow.com/a/27984038/2177408The text search feature in MongoDB (as at 2.6) does not have any built-in features for fuzzy/partial string matching. As you've noted, the use ca

2016-12-25 08:16:35 449

转载 How to use Elasticsearch with MongoDB?

http://stackoverflow.com/a/24119066/2177408This answer should be enough to get you set up to follow this tutorial on Building a functional search component with MongoDB, Elasticsearch, and A

2016-12-25 08:15:27 358

转载 Building a Recipe Search Site with Angular and Elasticsearch

https://www.sitepoint.com/building-recipe-search-site-angular-elasticsearch/By Adam Bard April 15, 2014Have you ever wanted to build a search feature into an application? In the

2016-12-25 08:14:34 616

转载 Sort a dictionary by value in JavaScript

http://stackoverflow.com/a/25500461/2177408You can try the following code. It gets sorted integer array by value.jsFiddle link function sortJsObject() { var dict = {"x" : 1, "y" : 6,

2016-12-25 05:56:06 351

转载 Find document with array that contains a specific value

If I have this schema...person = { name : String, favoriteFoods : Array}... where the favoriteFood array is populated with strings. How can I find all persons that have "sushi" as the

2016-12-25 05:35:55 326

转载 MongoDB Joins with MongooseJS

http://start.jcolemorrison.com/mongodb-joins-with-mongoosejs/Posted on 12 May by J Cole MorrisonIf you're going to have a cow about doing something relational in NoSQL, go have a

2016-12-25 05:29:13 306

转载 Check if object is array?

http://stackoverflow.com/a/34116242/2177408This is the fastest among all methods (all browsers supported):function isArray(obj){ return !!obj && Array === obj.constructor;}

2016-12-25 05:26:26 269

转载 Trying to get a list of collections from mongoose

http://stackoverflow.com/a/29461274/2177408From the provided information, it looks like you are using mongodb 2.0 driver. The db.collectionNames method was dropped. Check out the "Db Object" s

2016-12-25 05:17:26 336

转载 Do you want a timeout?

http://blog.mlab.com/2013/10/do-you-want-a-timeout/by chris on 2013/10/04 in GENERALYou’re feeling accomplished and excited; the new features for your application are finished, commi

2016-12-23 14:32:42 357

转载 MongoDB connection timeout

http://stackoverflow.com/a/39603895/2177408Error:  { [MongoError: connection 39 to 127.0.0.1:27017 timed out] name: 'MongoError', message: 'connection 39 to 127.0.0.1:27017 timed out' }S

2016-12-23 14:30:57 4513

转载 Define nested schema in Mongoose

http://stackoverflow.com/a/19701983/2177408trk : [{ lat : String, lng : String }]ortrk : { type : Array , "default" : [] }In the second case during insertion make th

2016-12-23 14:27:23 426

转载 mongoose入门(二)

http://www.html-js.com/article/1701Mogoose入门(二)模式虽然模式(Schema)在MongoDB的存储中并不是必须的,但是一般来说为了文档的整齐一致我们在Mongoose中还是会用到模式。可以说,Mongoose中的一切都从定义模式开始。使用过Mysql等关系数据库的同学一定对模式不陌生,简单来说,模式就是在数据之前先规

2016-12-23 13:41:59 560

转载 mongoose入门(一)

http://www.html-js.com/article/Mongoose-based-mongoose-entry-aMongoose是一个提供了MongoDB地相映射的Node.js库,它在Node.js中与ORM(Object Relational Mapping)有着类似的接口。如果你不熟悉ORM或者Mongoose中的Object Data Mapping(ODM),意思

2016-12-23 13:41:25 292

转载 Node.js : Using Promises with mongoosejs

http://blog.revathskumar.com/2015/07/using-promises-with-mongoosejs.htmlI was using mongoosejs for connecting mongoDB from my NodeJS app. When an action involve mulitple queries it tend to be

2016-12-23 13:39:01 307

转载 Switching out callbacks with promises in Mongoose

http://eddywashere.com/blog/switching-out-callbacks-with-promises-in-mongoose/Working with promises and mongoose just became a whole lot easier with the 4.1 release, which added the abilit

2016-12-23 13:38:20 293

转载 mongoose 多条件模糊查询的实现

作者:Smohan阅读:1972更新于2016-05-08 23:28这是今天手头项目中遇到的一个问题,关于mongoose如何实现类似于SQL中 `nick` LIKE '%keyword%' or `email` LIKE '%keyword%' 这种多条件模糊搜索的问题。 查阅了mongoose文档才得以实现,特此记录一下。主要用到了query.$or

2016-12-23 13:36:51 4874 1

原创 nodejs读取本地中文json文件出现乱码

1. 确定json文件是UTF-8 无BOM编码的的。如果有BOM,会在读取第一行的时候出现乱码。Per "fs.readFileSync(filename, 'utf8') doesn't strip BOM markers #1918", fs.readFile is working as designed: BOM is not stripped from the heade

2016-12-19 03:43:37 8358

转载 How to get simple dispatch from this.props using connect w/ Redux?

http://stackoverflow.com/questions/34458261/how-to-get-simple-dispatch-from-this-props-using-connect-w-reduxI've got a simple React component that I connect up (mapping a simple array/state over

2016-12-13 05:03:39 438

转载 Git HowTo: revert a commit already pushed to a remote repository

http://christoph.ruegg.name/blog/git-howto-revert-a-commit-already-pushed-to-a-remote-reposit.htmlSo you've just pushed your local branch to a remote branch, but then realized that one of the

2016-12-13 01:42:39 634

转载 Git - rebase

https://ruby-china.org/topics/22325这是一篇翻译文档(SL:https://help.github.com/articles/about-git-rebase/),同时参杂了部分自己的见解说在开讲前 这应该算是Git的高级功能了,为什么这么讲?大家回忆下自己日常使用Git的时候最常用的是哪些命令(branch, checkout, pu

2016-12-13 01:42:11 254

转载 Deleting a git commit

http://www.clock.co.uk/blog/deleting-a-git-commitBy Tom Smith9 September 2011 in TechWhen working with Git you will find that sometimes commits need to be removed as they have intr

2016-12-13 01:41:13 586

转载 Understanding and Using rem Units in CSS

https://www.sitepoint.com/understanding-and-using-rem-units-in-css/By Adrian Sandu October 06, 2015CSS units have been the subject of several articles here on SitePoint (such as A Look at

2016-12-13 01:27:49 464

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除