The MongoDB Web Shell
About The MongoDB Web Shell is a web application designed to emulate some of the features of the mongo terminal shell. This project has three main uses: try.mongodb.org, 10gen Education online classes, and the MongoDB API documentation. In
About
The MongoDB Web Shell is a web application designed to emulate some of the features of the mongo terminal shell. This project has three main uses: try.mongodb.org, 10gen Education online classes, and the MongoDB API documentation.
In these three different contexts, users will be able to familiarize themselves with the MongoDB interface and basic commands available both independently and as part of a 10gen education homework assignment in the education program.
See a screenshot of the state of the browser shell prior to this summer below:
Architecture
The user interfaces with the new MongoDB Web Shell through any web browser. A majority of the codebase for the project is written in Javascript executed in the browser. It provides a responsive command line interface similar to the MongoDB desktop shell. Because the MongoDB console is also implemented in Javascript, it is convenient to evaluate user-written code locally.
The browser-based shell interacts with a backing mongod instance through a RESTful interface implemented on top of Flask, a Python web application microframework. The backend provides
1) sandboxing capability to manage sessions and access to resources on the backing database 2) a framework for preloading data into a given resource 3) ability to verify data state for use in the online classes.
One interesting problem we ran into is allowing the blocking paradigm of code used by the mongo shells without actually blocking in the web browser. Browser tabs run on a single thread, so if Javascript code blocks on that thread, you can’t scroll or select things or interact with the tab at all. However, running code such as length = db.foo.aggregate(pipeline).results.length
traditionally requires that the aggregate call is a blocking request so that it can fetch the remote data and return it in a single function call. Normally, we should just rewrite out function calls to take callbacks, but since this is a web shell, we don’t have control over the code being written. Our solution was to write a Javascript evaluator that could pause execution at any time, similar to coroutines. This solution manifested itself in a library called suspend.js evaluates Javascript program strings and can pause execution, perform some arbitrary, possibly asynchronous actions, then resume execution with the result of those actions. Thus users can still write code in the blocking paradigm that the mongo shell uses without locking up the browser.
1) try.mongodb.org
One of the primary goals of the project is to replace the existing browser shell on try.mongodb.org. The newer version provides better support for javascript syntax and mongoDB features in a cleaner UI. Among the features that will be present in the shell are syntax highlighting (replacing the green on black styling), fully-featured Javascript, and a new tutorial system that integrates beyond the shell window in the containing page.
A screenshot of the new shell:
One of the challenges in developing a fully featured shell was the ability to execute user-written code in a sandboxed environment within the browser. Originally, the shell relied on parsing the code into an abstract syntax tree (AST) and mutating the source to namespace variables in a manner where var x
would become mongo.shells[index].vars['x']
. We quickly realized that this implementation would be difficult to maintain given potential feature growth and the number of edge case scenarios. Instead, the latest version of the shell delegates the scoping of variables to the browser by executing in an iframe element that intrinsically provides many sandboxing features.
2) 10gen Education
The MongoDB Web Shell will also make its debut on the 10gen Education platform where users learn to develop for and administer MongoDB quickly and efficiently. Currently, the assignments for the online classes must be downloaded and solved locally on an individual installation of MongoDB. With the web shell, students will be able to complete and submit assignments entirely within the education platform without needing to download and install their own copy of MongoDB or sample data. This online solution makes it more convenient for users to take courses wherever they may be and makes it easier to validate the correct completion of an assignment. Furthermore, users will no longer be required to load their own datasets using mongorestore since it is handled directly by the shell. Finally, since all the work is stored on their online account, students will be able to continue their work from where they left off from any computer.
3) MongoDB Documentation
Finally, the MongoDB Web Shell will be embedded into the API reference pages as part of the database’s documentation. This will allow a user to immediately test the commands detailed on the page and to evaluate its effects against provided sample data sets.
Resources
This project is Apache licensed open source software and is freely available through this Github repository. We have provided documentation using the Github wiki and welcome any feedback or contributions through issues and pull requests. The mentioned suspend.js library can be found at this Github repository.
About Us
The MongoDB Web Shell driver was developed by Ryan Chan and Danny Weinberg, who are currently interns at 10gen.
Acknowledgements
Special thanks to 10gen for hosting us as interns, Stacy Ferranti and Ian Whalen for managing the internship program, and our mentors Ian Bentley and Emily Stolfo for their help and support throughout the project.
原文地址:The MongoDB Web Shell, 感谢原作者分享。

Heiße KI -Werkzeuge

Undresser.AI Undress
KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover
Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool
Ausziehbilder kostenlos

Clothoff.io
KI-Kleiderentferner

AI Hentai Generator
Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

Heiße Werkzeuge

Notepad++7.3.1
Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version
Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1
Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6
Visuelle Webentwicklungstools

SublimeText3 Mac-Version
Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Heiße Themen



.NET 4.0 wird zum Erstellen einer Vielzahl von Anwendungen verwendet und bietet Anwendungsentwicklern umfangreiche Funktionen, darunter objektorientierte Programmierung, Flexibilität, leistungsstarke Architektur, Cloud-Computing-Integration, Leistungsoptimierung, umfangreiche Bibliotheken, Sicherheit, Skalierbarkeit, Datenzugriff und Mobilgeräte Entwicklungsunterstützung.

In diesem Artikel wird vorgestellt, wie MongoDB im Debian -System konfiguriert wird, um eine automatische Expansion zu erzielen. Die Hauptschritte umfassen das Einrichten der MongoDB -Replikat -Set und die Überwachung des Speicherplatzes. 1. MongoDB Installation Erstens stellen Sie sicher, dass MongoDB im Debian -System installiert ist. Installieren Sie den folgenden Befehl: sudoaptupdatesudoaptinstall-emongoDB-org 2. Konfigurieren von MongoDB Replika-Set MongoDB Replikate sorgt für eine hohe Verfügbarkeit und Datenreduktion, was die Grundlage für die Erreichung der automatischen Kapazitätserweiterung darstellt. Start MongoDB Service: SudosystemctlstartMongodsudosysys

In diesem Artikel wird beschrieben, wie man eine hoch verfügbare MongoDB -Datenbank für ein Debian -System erstellt. Wir werden mehrere Möglichkeiten untersuchen, um sicherzustellen, dass die Datensicherheit und -Dienste weiter funktionieren. Schlüsselstrategie: ReplicaSet: Replicaset: Verwenden Sie Replikaten, um Datenreduktion und automatisches Failover zu erreichen. Wenn ein Master -Knoten fehlschlägt, wählt der Replikate -Set automatisch einen neuen Masterknoten, um die kontinuierliche Verfügbarkeit des Dienstes zu gewährleisten. Datensicherung und Wiederherstellung: Verwenden Sie den Befehl mongodump regelmäßig, um die Datenbank zu sichern und effektive Wiederherstellungsstrategien zu formulieren, um das Risiko eines Datenverlusts zu behandeln. Überwachung und Alarme: Überwachungsinstrumente (wie Prometheus, Grafana) bereitstellen, um den laufenden Status von MongoDB in Echtzeit zu überwachen, und

Es ist unmöglich, das MongoDB -Passwort direkt über Navicat anzuzeigen, da es als Hash -Werte gespeichert ist. So rufen Sie verlorene Passwörter ab: 1. Passwörter zurücksetzen; 2. Überprüfen Sie die Konfigurationsdateien (können Hash -Werte enthalten). 3. Überprüfen Sie Codes (May Hardcode -Passwörter).

Pinetwork startet Pibank, eine revolutionäre Mobile -Banking -Plattform! PiNetwork today released a major update on Elmahrosa (Face) PIMISRBank, referred to as PiBank, which perfectly integrates traditional banking services with PiNetwork cryptocurrency functions to realize the atomic exchange of fiat currencies and cryptocurrencies (supports the swap between fiat currencies such as the US dollar, euro, and Indonesian rupiah with cryptocurrencies such as PiCoin, USDT, and USDC). Was ist der Charme von Pibank? Lass uns herausfinden! Die Hauptfunktionen von Pibank: One-Stop-Management von Bankkonten und Kryptowährungsvermögen. Unterstützen Sie Echtzeittransaktionen und übernehmen Sie Biospezies

MongoDB eignet sich besser für die Verarbeitung unstrukturierter Daten und schneller Iteration, während Oracle besser für Szenarien geeignet ist, die eine strenge Datenkonsistenz und komplexe Abfragen erfordern. 1. Das Dokumentmodell von MongoDB ist flexibel und geeignet für den Umgang mit komplexen Datenstrukturen. 2. Das Beziehungsmodell von Oracle ist streng, um die Datenkonsistenz und die komplexe Abfrageleistung sicherzustellen.

Sortierindex ist eine Art von MongoDB -Index, mit dem die Sortierung von Dokumenten in einer Sammlung nach bestimmten Feldern sortiert werden kann. Durch das Erstellen eines Sortierindex können Sie die Ergebnisse der Abfrageergebnisse ohne zusätzliche Sortiervorgänge schnell sortieren. Zu den Vorteilen gehören schneller Sortieren, Überschreibungsanfragen und On-Demand-Sortieren. Die Syntax ist db.collection.createinNex ({field: & lt; sortieren order & gt;}), wobei & lt; sortieren order & gt; ist 1 (aufsteigende Ordnung) oder -1 (absteigende Reihenfolge). Sie können auch Multi-Field-Sortierindizes erstellen, in denen mehrere Felder sortiert werden.

MySQL kann PDF -Dateien nicht direkt speichern und kann durch Speichern von Dateipfaden oder Hash -Werten von Binärdaten erreicht werden. Die Kernidee besteht darin, eine Tabelle zu verwenden, um die folgenden Felder zu speichern: ID, Dateiname, Dateipfad (oder Hash -Wert). Das Dateipfadschema speichert Dateipfade, die einfach und effizient sind, aber vom Dateisystem für die Sicherheit abhängen. Das Datei-Hash-Schema speichert den SHA-256-Hash-Wert von PDF-Dateien, der sicherer ist und die Überprüfung der Datenintegrität durchführen kann.
