Skip to content

Migrating from 0.3.x to 0.4.x

Cristian Douce edited this page Feb 26, 2014 · 2 revisions

law.publishedAt, law.public, law.draft

A new field named publishedAt has been added with the admin back-office feature at this release. This allows to separate laws into draft and public categories (values which also are virtuals of the Law model).

In order to display your already public laws you need to run the following command at your MongoDB shell:

db.laws.find().forEach(function(doc){
  db.laws.update({ _id: doc._id }, { $set: { publishedAt: doc.createdAt }});
});

After this, the publishedAt date will be set to the time the law becomes public from the back-office publication.