Created
February 11, 2012 18:36
-
-
Save agnaldo4j/1803476 to your computer and use it in GitHub Desktop.
Smalltalk pharo and mongodb
This file contains 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
| root database processes json template result| | |
root := Mongo default. | |
root open. | |
database := root databaseNamed: 'lean_namagement'. | |
processes := database addCollection: 'processes'. | |
json := Dictionary new. | |
json at: #name put: 'agnaldo'. | |
processes add: json. | |
template := Dictionary new. | |
template at: #name put: 'agnaldo'. | |
processes query: template. | |
result := OrderedCollection new. | |
processes do:[: process | | |
((process at: #name) beginsWith: 'ag') ifTrue: [ | |
result add: process | |
] | |
]. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment