This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package mongo; | |
| import org.bson.Document; | |
| public class DocumentTest { | |
| public static void main(String[] args) { | |
| Document document = new Document() | |
| .append("str", "MongoDB, hello!"); | |
| String str = document.getString("str"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mongo shell is interactive javascript interpretor. Mongo shell can return previous input. | |
| BSON is binary encoded a computer data interchange format used mainly as data storge and network transfer format in mongodb. Is based on the term json. | |
| Inserting Docs | |
| Documents in mongo live inside a collection. Inside shel language we see collections as properties of database. | |
| findOne | |
| method find one document that contains query argument | |
| findOne(a, b), where a - what you want to find, b - what you want to display. example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| +86937 isset | |
| +43159 echo | |
| +31697 empty | |
| +29252 substr | |
| +26146 count | |
| +24248 is_array | |
| +22572 strlen | |
| +19365 sprintf | |
| +18090 unset | |
| +16584 str_replace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Культура программирования как раз основана на знаниях (но не только), и это основная ценность в сообществе разработчиков. |