This article mainly introduces the PHP operation MongoDB Concise tutorial, including joins, adds, modifies, deletes, the inquiry and so on, needs the friend to be possible to refer to under nbsp; Code as follows://connection localhost:27017 $conn = new Mongo (); nbsp;//Connect remote host default port $conn = new Mongo (' test.com '); nbsp;//Connect remote host 22011 port $conn = new Mongo (' test.com:220
using a C-type shell, the default prompt character%.
There are also a variety of Bourne shell subcategories listed below:
· Bourne Shell (SH)
· Korn Shell (Ksh)
· Bourne Again Shell (bash)
· POSIX Shell (SH)
The different C-type
Shell Getting Started Tutorial: Shell variables
Variable
A variable is a place to store data temporarily, and is a memory space. Bash shell and other programming languages, there is no "data form", which means that the default is not to distinguish between a variable is an integer or a floating-point type, unless you
Tags: cut exit Express Concise tutorial Call Shell variable experience syntax table
Series article starter platform for Jelly want personal blog. Jelly think, is an original technical article sharing site. Here jelly will share his technical experience, technical gains and losses, technical life. I want to wait for you in jelly, and I hope you can share with me your technical loss and expectations.
This article mainly introduces the tutorial on using external engine to operate MongoDB in Python, including some tips for using Django. if you need it, you can refer to the following to pick up Django again recently, but Django does not support mongodb, however, there is a module, the runtime engine, which can implement encapsulation similar to the Django Model.
("4c637f79900f00000000686d"), "UID": 1, "username": "admin", "password": "Admin"}This is the shell of the MONGO, if you use a server-side program Java PHP python, you can encapsulate these operations, only a few parameters can return the self-increment ID, but also to achieve a cross-table like Oracle self-increment ID.
I wrote a piece of PHP, take it out for everyone to share.
I hope this article is helpful to everyone's PHP programming.
http://ww
1. Basic query:
Constructs query data.
Copy Code code as follows:
> Db.test.findOne ()
{
"_id": ObjectId ("4fd58ecbb9ac507e96276f1a"),
"Name": "Stephen",
"Age": 35,
"Genda": "Male",
"Email": "stephen@hotmail.com"
}
--Multi-condition query. The following example is equivalent to the WHERE name = "Stephen" and age = 35 of the SQL statement
> Db.test.find ({"Name": "Stephen", "Age": 35})
{"_id": ObjectId ("4fd58ecbb9ac507e96276f1a"), "name": "Stephen", "Age": "Genda": "Male"
between 1 to 5:"Read AnumCase $aNum in1|2|3|4|5) echo "Your number is $aNum!";;* echo "You don't select a number between 1 to 5!"Continueecho "Game is over!";;EsacDone
Running code found that when you enter a number greater than 5, the loop in the example does not end, and the statement
echo "Game is over!"
Will never be executed.
Shell Functions
All scripts so far in this tutorial have been executed
Create a directory as follows
Extract the MongoDB compressed package into the MongoDB directory
Mongodata Create the Data directory to store the information; Create the log directory to store the directory
CMD input command:
D:\mongo\mongodb\bin\mongod.exe--dbpath "D:\mongo\mongodata\data"--logpath "D:\mongo\mongodata\log\MongoDB.log"- -install--service
Shell Getting Started Tutorial (1)-shell-JUSTKK's Column-Blog channel-csdn.nethttp://blog.csdn.net/justkk/article/details/43795131
Shell Getting Started Tutorial (2)-Variables and Parameters-JUSTKK-Blog channel-csdn.nethttp://blog.csdn.net/justkk/article/details/44081993
Big Data Architecture Development mining analysis Hadoop HBase Hive Storm Spark Flume ZooKeeper Kafka Redis MongoDB Java cloud computing machine learning video tutorial, flumekafkastorm
Training big data architecture development, mining and analysis!
From basic to advanced, one-on-one training! Full technical guidance! [Technical QQ: 2937765541]
Get the big data video
script rotatefile can solve this problem. This script can rename the message to save the file (assuming outmail) is OUTMAIL.1, and for outmail.1 it becomes outmail.2 and so on ...
The code is as follows:
#!/bin/sh
# vim: set sw=4 ts=4 et:
ver="0.1"
help()
{
cat
How does this script work? After detecting a file name provided by the user, we perform a 9 to 1 loop. File 9 is named 10, file 8 is renamed to 9, and so on. After the loop is complete, we name the original file 1
"error:no such option $. -H for Help "; exit 1;;
*) break;;
Esac
Done
# input Check:
If [-Z ']; Then
Error "Error:you must specify a file, use-h for help"
Fi
Filen= "$"
# Rename any. 1,. 2 etc File:
For N in 9 8 7 6 5 4 3 2 1; Do
If [-F ' $filen. $n "]; Then
p= ' expr $n + 1 '
echo "MV $filen. $n $filen. $p"
MV $filen. $n $filen. $p
Fi
Done
# Rename the original file:
If [-F "$filen"]; Then
echo "MV $filen $filen. 1"
MV $filen $filen. 1
Fi
echo Touch $filen
Touch $filen
How does this script wor
Training Big Data architecture development, mining and analysis!from zero-based to advanced, one-to-one training! [Technical qq:2937765541]--------------------------------------------------------------------------------------------------------------- ----------------------------Course System:get video material and training answer technical support addressCourse Presentation ( Big Data technology is very wide, has been online for you training solutions!) ):Get video material and training answer
import--oplogreplay Replay oplog for Point-in-time restore--oploglimit Arg include Oplog entries before the provided Timestamp (seconds[:ordinal]) during the Oplog replay; the ordinal value is optional--keepindexversion don ' t upgrade indexes to newest version--nooptionsrestore don ' t restore collection options--noindexrestore don ' t restore indexes--w Arg (=0) Minimum number of replicas per write
Actual operation:MongoDB Backup of the database:/data/
, adhere to the principle of diversification, choose a better and more economical way, rather than top-down unification. More commonly, we can directly use MongoDB to store key value pairs of data types, such as: Verification Code, session, etc. due to MongoDB's scale-out capability, it can also be used to store data that is very large in the future, such as: logs, comments, etc. Because MongoDB stores the
# input Check:If [-Z ']; ThenError "Error:you must specify a file, use-h for help"FiFilen= "$"# Rename any. 1,. 2 etc File:For N in 9 8 7 6 5 4 3 2 1; DoIf [-F ' $filen. $n "]; Thenp= ' expr $n + 1 'echo "MV $filen. $n $filen. $p"MV $filen. $n $filen. $pFiDone# Rename the original file:If [-F "$filen"]; Thenecho "MV $filen $filen. 1"MV $filen $filen. 1Fiecho Touch $filenTouch $filenHow does this script work? After detecting a file name provided by the user, we perform a 9 to 1 loop. File 9 is na
for Root (/sbin/sh)......This tutorial focuses on bash, the Bourne Again Shell, which is widely used in daily work due to its ease of use and free. At the same time, bash is the default shell for most Linux systems.In general, people do not differentiate between the Bourne shell and the Bourne Again
Tutorial on using external engine to operate MongoDB in Python, using enginemongodb
Recently, Django was picked up again, but Django does not support mongodb. However, there is a module, the runtime engine, which can implement similar encapsulation of Django Model. however, there are almost no Chinese documents for the engine, and some of them are short introduct
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.