import com.google.gson.Gson;
import org.bson.Document;
import java.net.URL;
import java.time.LocalDateTime;


/**
 * Article from RSS/Atom feed.
 */
public class Article {
    /**
     * Headline of the article
     */
    public String headline;
    public LocalDateTime publishedDateTime;
    public LocalDateTime updatedDateTime;
    public URL url;
    public String author;
    public String content;

    public Article(String headline, LocalDateTime publishedDateTime) {
        this.headline = headline;
        this.publishedDateTime = publishedDateTime;
    }

    /**
     * Checks, if a article equals another one based on headline and published time.
     * @param a The other article
     * @return true if both articles are equal, otherwise false
     */
    public boolean equals(Article a) {
        if (a.headline.equals(headline) && a.publishedDateTime.equals(publishedDateTime)) {
            return true;
        }
        return false;
    }

    /**
     * Returns the article as a Document
     * @return the current article as a org.bson.Document
     */
    public Document getDocument() {
        Document document = new Document();
        document.append("headline", headline);
        document.append("publishedDateTime", publishedDateTime);
        document.append("updatedDateTime", updatedDateTime);
        document.append("url", url);
        document.append("author", author);
        document.append("content", content);
        return document;
    }


}

@@ -101,16 +101,59 @@
 teTime;%0A
+import java.time.format.DateTimeFormatter;%0A
 %0A%0A/**%0A *
@@ -1148,24 +1148,210 @@
 ocument() %7B%0A
+        // Use a DateTimeFormatter to convert the LocalDateTime objects to a mongo readable format.%0A        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME;%0A%0A
         Docu
@@ -1483,32 +1483,58 @@
 ublishedDateTime
+.format(dateTimeFormatter)
 );%0A        docum
@@ -1578,16 +1578,42 @@
 DateTime
+.format(dateTimeFormatter)
 );%0A     

use DateTimeFormatter for datetime fields