Skip to content

Instantly share code, notes, and snippets.



Created Feb 11, 2012
What would you like to do?
Smalltalk pharo and mongodb
| 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