Closed howtotalktogirlsatparties closed 4 months ago
Hi @howtotalktogirlsatparties,
It's outdated and deprecated probably, but why do this when you can use Lockheed Martin's python
-mongor` Lockheed Martin have really good scripts til this day, for example:
#!/bin/bash
SPEC_FILE=python-pymongor.spec
# Change to source dir
cd $(dirname $0)/../
SRC_DIR=`pwd`
echo 'Running setup.py bdist_rpm'
python setup.py bdist_rpm
echo 'Setting up build environment'
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
echo 'Copying source files to rpmbuild directory'
cp dist/*.tar.gz ~/rpmbuild/SOURCES/
cp rpm/rotate_mongodb.cron ~/rpmbuild/SOURCES/
cp scripts/mongor_manage.py ~/rpmbuild/SOURCES/
cp rpm/$SPEC_FILE ~/rpmbuild/SPECS/
echo 'Making RPM'
cd ~/rpmbuild/SPECS/
rpmbuild -ba $SPEC_FILE
I recommend you taking a look at the Mongo repo: https://github.com/lmco/python-mongor.
Cheers, Montana Mendy
If you’ve Mongo you’ve discovered that communicating with MongoDB via Documents is painful. We care about storing our domain objects and having powerful ways of fetching them again from the data store. How do we accomplish those tasks when then tool doesn’t offer those options?
The answer is, of course, we extend the tool so that we can express our intent in the most natural language we can. To me this means Linq or some reasonable subset thereof.
So lets start with the domain object Person:
The object is marked Serializable but is otherwise unremarkable. If I have an instance of person I’d like to be able to simply pass it to a Save method on the collection as follows.
We can’t change the IMongoCollection object directly but we can use an extension method to build the interface we’re looking for:
I know there is some support for FluentMongo, but is this possible?