Spring Data MongoDB – Indexes, Annotations and Converters

Indexed This annotation marks the field as indexed in MongoDB

Compound Indexes MongoDB supports compound indexes, where a single index structure holds references to […]

Continue reading »

Spring Data MongoDB : Query document

Test Data

BasicQuery example

findOne example

find and $inc example

find and $gt, $lt, $and example

You can’t use Criteria.and() […]

Continue reading »

Install MongoDB on OpenSuse

after install run

the restart service and run with config

other commands

References https://docs.mongodb.com/v3.0/reference/configuration-options/ http://stackoverflow.com/questions/23943651/mongodb-admin-user-not-authorized http://stackoverflow.com/questions/35881662/mongodb-error-not-authorized-to-execute-command https://docs.mongodb.com/manual/tutorial/enable-authentication/ http://stackoverflow.com/questions/23003391/how-do-i-add-an-admin-user-to-mongo-in-2-6

Continue reading »

Sessions in Express.js

Setting Session Variables

Reading Session Variables

Updating Session Variables

Deleting Session Variables

Deleting a Session

References http://expressjs-book.com/index.html%3Fp=128.html […]

Continue reading »

Remove values from an existing array in MongoDB

Before

After

References https://docs.mongodb.com/manual/reference/operator/update/pull/#pull http://stackoverflow.com/questions/16959099/how-to-remove-array-element-in-mongodb

Continue reading »

Install MongoDB as Windows Service

create a file at C:\mongodb\mongod.cfg

Install the MongoDB service

Start the MongoDB service

Stop or remove the MongoDB service as needed […]

Continue reading »