MongoLink`
MongoLink`

MongoConnect

MongoConnect[]

create a client object MongoClient using hostname "localhost" and port number 27017.

MongoConnect[host]

create a MongoClient using hostname host.

MongoConnect[assoc]

create a MongoClient using the components in the association assoc.

更多信息和选项

  • To use MongoConnect, you first need to load MongoLink using Needs["MongoLink`"].
  • The association assoc has the following components:
  • "Host""localhost"connection hostname.
    "Port"27017connection port.
    "Username"Noneusername to use for connection.
    "Password"Nonepassword to use for connection.
    "SSL"Automaticwhether to enable SSL.
    VerifySecurityCertificatesTruewhether to verify the validity of SSL certificate files.
    "AllowInvalidHostname"Falsewhether to disable hostname validation.
    "CAFile"Nonethe path to a Certificate Authority file.
    "CertificateRevocationList"Nonepath to a PEM or DER formatted certificate revocation list.
    "PEMFile"Nonepath to a PEM file.
    "PEMFilePassword"Nonepassword for PEM file.
  • "Password"->"$Prompt" opens a dialog box that will prompt the user for the password. This can help keep the password more secure.
  • To use MongoConnect to connect to MongoDB Atlas, follow the instructions here to obtain a URI connection string (eg "mongodb+srv://kay:myRealPassword@cluster0.mongodb.net/"). Using this URI and the default Certificate Authority file included in MongoLink $MongoDefaultCAFile, connect via MongoConnect[<|"Host"->"mongodb+srv://kay:myRealPassword@cluster0.mongodb.net/","CAFile" $MongoDefaultCAFile|>].

范例

基本范例  (2)

Connect to a MongoDB server running locally:

This is equivalent to:

Connect to a MongoDB server running locally via a MongoDB URI string:

Specifying the port:

Wolfram Research (2018),MongoConnect,Wolfram 语言函数,https://reference.wolfram.com/language/MongoLink/ref/MongoConnect.html.

文本

Wolfram Research (2018),MongoConnect,Wolfram 语言函数,https://reference.wolfram.com/language/MongoLink/ref/MongoConnect.html.

CMS

Wolfram 语言. 2018. "MongoConnect." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/MongoLink/ref/MongoConnect.html.

APA

Wolfram 语言. (2018). MongoConnect. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/MongoLink/ref/MongoConnect.html 年

BibTeX

@misc{reference.wolfram_2024_mongoconnect, author="Wolfram Research", title="{MongoConnect}", year="2018", howpublished="\url{https://reference.wolfram.com/language/MongoLink/ref/MongoConnect.html}", note=[Accessed: 18-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_mongoconnect, organization={Wolfram Research}, title={MongoConnect}, year={2018}, url={https://reference.wolfram.com/language/MongoLink/ref/MongoConnect.html}, note=[Accessed: 18-November-2024 ]}