• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

I can't see the topic on category page when I use db.objects.insert

Scheduled Pinned Locked Moved Unsolved Technical Support
6 Posts 3 Posters 544 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    khaled Gamers
    wrote on last edited by
    #1

    I successfully create 7/new-topic-example page by using the command below, but it is not listed on category page and home page. Is this correct way to insert data?

    db.objects.insert({_key:"topic:7","cid":2,"lastposttime":1625553855706,"mainPid":7,"postcount":22,"slug":"7/new-topic-example","tid":7,"timestamp":1625553855705,"title":"new topic example","uid":1,"viewcount":33,"postercount":22})

    Many Thanks
    Khaled

    1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    wrote on last edited by
    #2

    The correct way to insert data would be to use the http write API. Doing it via direct db operations is much more complicated than what you did.

    K 2 Replies Last reply
    1
  • K Offline
    K Offline
    khaled Gamers
    replied to PitaJ on last edited by
    #3

    Many thanks @pitaj, I will try write API

    1 Reply Last reply
    0
  • K Offline
    K Offline
    khaled Gamers
    replied to PitaJ on last edited by khaled
    #4

    @pitaj I successfully post a topic through API.
    But I am wondering how I can send multi topic on one request

    Like:

    {
    "cid": 2,
    "title": "Test topic 1",
    "content": "1 This is the test topic's content",
    },
    
    {
    "cid": 2,
    "title": "Test topic 2",
    "content": "2 This is the test topic's content",
    }
    
    julianJ 1 Reply Last reply
    0
  • julianJ Online
    julianJ Online
    julian GNU/Linux
    replied to khaled on last edited by
    #5

    @khaled you cannot, just make multiple http requests

    K 1 Reply Last reply
    0
  • K Offline
    K Offline
    khaled Gamers
    replied to julian on last edited by
    #6

    @julian I want to post large number of topics at once on JSON format, and it will be frequently use under one user id.

    Does body-parser has the ability? and is it easy to modify api/v3/topics ?

    Many Thanks,
    Khaled

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development