In the use of MySQL often need to do like query, when the storage media switch to MONGO, we also need to use this situation, thanks to MONGO provide regular expression operation, we can use it to
Python blur Query
def query (): conn = Connection (' 127.0.0.1 ', 27017) db = GetAttr (conn, ' dbname ') coll = getattr (db, ' Collname ') #使用正则查询 Import Re q = rs.compile (R ' Add ') #完成正则 R '. * ', R ' [a-z]+ '
Some records recorded by date in development require statistics in various dimensions, such as day, month, year, and hour ,.. For Grouping statistics, some fields need to be de-duplicated. In the previous [Mongo] grouping statistics by time (group time formatting), group is used to achieve day-by-day statistics, however, the newDate () method may be a bit difficult. Today I read about aggreg.
Some records recorded by date in development require statis
Encapsulate a NLog + NLog. Mongo-based logging tool LogUtil and nloglogutil
Encapsulate an object based on NLog + NLog. the Mongo Logging Tool class is LogUtil. The code is relatively simple. It mainly integrates the logging target configuration and FileTarget configuration into the class, and uses the cache dependency to determine whether to re-create the Logger class, the complete code is as follows:
Usin
Mongo-js-20141126, JavaScript#! /Bin/sh# Create a 0-byte document. If yes, clear it.:> SubsidiaryCode.txtTlist = 'cat./AccountGuid.txt ';For I in $ tlistDoTEMP_LIST = $ I;# Print the value obtained from $ TEMP_LIST.# Printf "AccountGuid: $ TEMP_LIST \ n ";Mysql-h 172.24.0.220-uquery-pquery che001-NB Select ReferalGuid, UserGuid from KyPayAccounts where AccountGuid = '$ TEMP_LIST ';EOF# Get Referal_user_IdReferal_user_Id = 'cat./Referal_user_Id.txt ';#
Following the previous article, this article is mainly implemented by the C # version of Mongo map-Reduce. If you are not familiar with the C # driver, it doesn't matter. The MongoDB official website has a good getting started article, you will soon learn how to write the Mongo program in C #, instead of entering commands on the console every day. Getting StartedWith the CSHARP driver.
Let's go back to the
After you stop balancer, back up the entire Shard library, and then enable balancer to delete the Shard set merge rebuild. Encountered the following error:Mongos> Db.businessInfo.drop ();2016-08-14t09:06:58.324+0800 E QUERY Error:drop failed: {"Code": 13331,"OK": 0,"ErrMsg": "Exception:collection ' s metadata is undergoing changes. Please try again. "}At Error (At Dbcollection.drop (src/mongo/shell/collection.js:620:15)at (Shell): 1:12 at src/
PHP Configuration MONGO Extensions
a) Download Php_mongo.dll
Official Download Address:
Http://www.php.net/manual/en/mongo.installation.php#mongo.installation.windows
See the version of the file when downloading, the same as the version you use PHP
If the version is using the wrong MONGO extension cannot be enabled, download and drop it into the PHP extension folder
b) Modify the php.ini file
Add ex
Issue: MONGO run Error: Failed to connect 127.0.0.1:27017,reason:errno:10061 Unable to connect due to target computer actively rejectingIn the MongoDB installation process encountered problems, first understand the MongoDB installation steps1. Download the corresponding version on the MongoDB website, https://www.mongodb.org/downloads2. Unzip the downloaded file to the C drive or the D packing directory3. Use the cmd command mkdir data to create the d
Spring inherits MONGO is using Spring-data.If you need to add two MONGO with Spring integrated package, Spring-data-commons-1.7.0.release.jar,spring-data-mongodb-1.4.0.release.jar.Configuration of the MONGOXML version= "1.0" encoding= "UTF-8"?>Beansxmlns= "Http://www.springframework.org/schema/beans"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xmlns:context= "Http://www.springframework.org/schema/c
Read Preference mode for MONGO
MONGO query process, the default is the primary mode, that is, from the Master node query. There are other patterns, of course. A bit of the main mode is that you can always read the latest data, the disadvantage is that the read and write at the same node, the load is relatively high.
MONGO several modes of query,
Primary: By de
Label:The work of the hand is not very busy, so to learn to study for a long time like contact with MongoDB, but the previous period of work time are more. The records are here for future reference. Environment: Centos 7 64-bit Begin: 1. Download Mongo:wget on the websitehttps://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-3.0.3.tgz Tar-zxvfmongodb-linux-x86_64-rhel70-3.0.3.tgz There are 13 executable programs under the bin file. Where./mongo
This article introduces briefly, using the official driver to operate MongoDB. As for the MongoDB native additions and deletions to change the statement, and so later to learn slowly.One, the operation of MongoDB Drive mainly have two1. Official driver: https://github.com/mongodb/mongo-csharp-driver/downloads, newer or more timely, has now supported the large-sector LINQ syntax.2.samus Drive: Https://github.com/samus/mongodb-csharp/downloads. This see
Php configuration mongo extension
A) download php_cmd.dll
Official:
Http://www.php.net/manual/en/mongo.installation.php#mongo.installation.windows
The file version must be the same as the php version.
If the version is used incorrectly, the mongo extension cannot be enabled. download it and put it in the php Extension folder.
B) modify the php. ini file.
Add extension = php_cmd.dll
C) restart apac
MONGO extended upgrade to MongoDB
The original New Mongodate () is not available, is there an alternative way?
Reply content:
MONGO extended upgrade to MongoDBThe original New Mongodate () is not available, is there an alternative way?
This class is provided as a DateTime class in the new extension \MongoDB\BSON\UTCDateTime .Classes that are convertible during the migration from the old extension to
explanation
$size
If the return value is in the form of an array, define its return array element number
Note
name
Description
$comment
Add a description or remark to the command
》
$where
"this.credits == this.debits""obj.credits == obj.debits"returnreturn obj.credits == obj.debits; } } );where接受字符串函数两种形式的参数,其中也提供了一些函数。assert()BinData()DBPointer()DBRef()doassert()emit()gc()He
For php 5.2.9, php-mongo extensions of version 5.2 cannot be installed but version 5.3 can be used .??? Today, I installed the php extension for mongodb. my php version is 5.2.9-2. I saw two versions on the official mongodb website: 5.2 and 5.3, 5.2 and 5.3 are both 5.2.9 versions of php, and Version 5.2 of php-mongo extensions cannot be installed but can be used.
?? ? Today, I installed the php extensio
Two forms of MONGO are analyzed:
1. Mongo sharding Way: 1.1. Problems with deep ploughing pagesExample: When the MONGO Shard is 5, paging query (if the creation time flashbacks query) the first page, 50 data per page, then MONGO sharding 50 data on each shard, a total of 505 data, and then summarized, calculated the f
This article mainly introduces the export MONGO library to the local, has a certain reference value, now share to everyone, the need for friends can refer to
Demand:
Under the YII framework, export the data from the production MONGO library to the JSON file and download to the local
Call:
1. Quoting under/web/controllers/testcontroller.php
Public Function Actionexport () {public $target = '/www/w
Some extensions of PHP installed under Debian geoip,mongo,redis,libevent,proctitle,inotify,pcntl
Because of the relationship of the project, some new extensions need to be installed
Debian Xfce 7.2 x86 The following 3 are installed through Apt-get.
PHP 5.4.4-14+deb7u5 (CLI)
nginx1.2.1
Apache 2.2.22
1: Installed by default method (optimal), most commonly used in the Debian warehouse, can be downloaded to note, #是代表root can be through Su-enter the pa
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.