Skip to content

Instantly share code, notes, and snippets.

@agnaldo4j
Created February 11, 2012 18:36
Show Gist options
  • Save agnaldo4j/1803476 to your computer and use it in GitHub Desktop.
Save agnaldo4j/1803476 to your computer and use it in GitHub Desktop.
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